User:MarcusC/TalosOpBuild

From RCS Wiki
< User:MarcusC
Revision as of 05:26, 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);