User:MarcusC/TalosOpBuild

From RCS Wiki
< User:MarcusC
Revision as of 07:38, 15 February 2018 by MarcusC (talk | contribs)
Jump to navigation Jump to search

Some notes on building talos-op-build

Required packages on gentoo

When building on gentoo, the following packages need to be installed:

dev-perl/XML-Simple
dev-perl/XML-LibXML
dev-util/cscope
sys-libs/zlib[static-libs]

host-libopenssl-1.0.2m builds in 32-bit mode

If a compilation error complaining about the lack of <gnu/stubs-32.h> appears, this is because the libopenssl package is trying to compile in 32-bit mode and no 32-bit CRT is installed.

To fix, set the environment variable KERNEL_BITS to force a 64-bit build:

export KERNEL_BITS=64
rm -rf output/build/host-libopenssl-1.0.2m
op-build

Broken hcode reference

The Makefile for the hcode package (openpower/package/hcode/hcode.mk) specifies 37069e1756e2b8e70e8e185d28609414033dbc02 as the version to checkout. However, no such commit exists in the git repo (https://scm.raptorcs.com/scm/git/talos-hcode). Current master is at e45e1293f43a534fc180133ec588733035cd2dc8. Maybe Raptor forgot to push something?

As a workaround, change the value of HCODE_VERSION in the Makefile from 37069e1756e2b8e70e8e185d28609414033dbc02 to e45e1293f43a534fc180133ec588733035cd2dc8.

FTBFS in hcode

Compiling the current master of hcode (e45e1293f43a534fc180133ec588733035cd2dc8), the following fatal error is generated:

../../import/chips/p9/procedures/ppe/tools/ppetracepp//ppetracepp.C: In function
 ‘int main(int, char**)’:
../../import/chips/p9/procedures/ppe/tools/ppetracepp//ppetracepp.C:1097:36: err
or: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with att
ribute warn_unused_result [-Werror=unused-result]
         fgets(buf, MAX_BUFFER, PWD);
                                    ^
cc1plus: all warnings being treated as errors

To fix, place the following patch in openpower/package/hcode/fgets.patch:

--- a/import/chips/p9/procedures/ppe/tools/ppetracepp/ppetracepp.C	2018-02-15 11:37:48.995064250 +0100
+++ b/import/chips/p9/procedures/ppe/tools/ppetracepp/ppetracepp.C	2018-02-15 11:47:24.463767244 +0100
@@ -1094,7 +1094,7 @@
 
         string pwd;
         FILE* PWD = popen("pwd", "r");
-        fgets(buf, MAX_BUFFER, PWD);
+        if(!fgets(buf, MAX_BUFFER, PWD)) fprintf(stderr, "Failed to run pwd\n");
         pwd = buf;
         pclose(PWD);
         time_t tt = time(NULL);

FTBFS in host-squashfs

There is a missing #include directive in the squashfs sources used, which leads to compilation errors such as these:

mksquashfs.c: In function ‘create_inode’:
mksquashfs.c:991:24: error: called object ‘major’ is not a function or function 
pointer
   unsigned int major = major(buf->st_rdev); 
                        ^~~~~

To fix, place the following patch in buildroot/package/squashfs/sysmacros.patch:

--- a/squashfs-tools/mksquashfs.c       2018-02-15 14:11:24.661930637 +0100
+++ b/squashfs-tools/mksquashfs.c       2018-02-15 14:12:28.218412025 +0100
@@ -44,6 +44,7 @@
 #include <setjmp.h>
 #include <sys/types.h>
 #include <sys/mman.h>
+#include <sys/sysmacros.h>
 #include <pthread.h>
 #include <regex.h>
 #include <fnmatch.h>
--- a/squashfs-tools/unsquashfs.c       2018-02-15 14:25:34.608263881 +0100
+++ b/squashfs-tools/unsquashfs.c       2018-02-15 14:26:01.376410327 +0100
@@ -35,6 +35,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
+#include <sys/sysmacros.h>
 #include <limits.h>
 #include <ctype.h>