Hi,
When I followed the procedure for GN build of
'Simple Chrome' (I used '--chroot' to use my own build of Chrome OS;
cros chrome-sdk --board=$BOARD --chroot=/path/to/chromiumos/chroot
) , I keep getting an error from ld.gold about '--warn-poison-system-directories: unknown option'. I searched for that option in the source tree, but couldn't find it anywhere. (btw, SDK_BOARD is 'x86-alex')
FAILED: chrome_sandbox
i686-pc-linux-gnu-g++ -B/usr/local/google/w/cr/t/.cros_cache/chrome-sdk/tarballs/x86-alex+8329.0.0+target_toolchain/usr/x86_64-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.25.51-gold -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -fuse-ld=gold -B../../third_party/binutils/Linux_x64/Release/bin -Wl,--icf=safe -pthread -m32 -Wl,-O1 -Wl,--gc-sections -Wl,--as-needed --sysroot=../../../../../../../../../w/cros/t/chroot/build/x86-alex -L/w/cros/t/chroot/build/x86-alex/lib -Wl,-rpath-link=/w/cros/t/chroot/build/x86-alex/lib -L/w/cros/t/chroot/build/x86-alex/usr/lib -Wl,-rpath-link=/w/cros/t/chroot/build/x86-alex/usr/lib -L/w/cros/t/chroot/build/x86-alex/usr/local/lib -Wl,-rpath-link=/w/cros/t/chroot/build/x86-alex/usr/local/lib -L/w/cros/t/chroot/build/x86-alex/usr/i686-pc-linux-gnu/lib -Wl,-rpath-link=/w/cros/t/chroot/build/x86-alex/usr/i686-pc-linux-gnu/lib -Wl,-rpath-link=../Release -Wl,--disable-new-dtags -Wl,-O1 -Wl,-O2 -Wl,--as-needed -o "./chrome_sandbox" -Wl,--start-group @"./chrome_sandbox.rsp" -Wl,--end-group -ldl -lrt
../../third_party/binutils/Linux_x64/Release/bin/ld.gold: --warn-poison-system-directories: unknown option
../../third_party/binutils/Linux_x64/Release/bin/ld.gold: use the --help option for usage information
collect2.elf: error: ld returned 1 exit status
Has anybody had a similar issue? If so, what can I do to avoid this problem?
Thanks,
Jungshik
P.S.
Before the above issue, I got the following error from goma for many source files. That I got fixed by 'gn args ...' and changing cros_host* (by dropping '-pc-').
GOMA:g++ compiling ../../third_party/protobuf/src/google/protobuf/field_mask.pb.cc:*ERROR*: compiler_proxy:62ms: Failed to find local compiler path
I figured that '-pc' is problematic for host/v8 compilers. I don't have any of them. Instead, what I have on my Ubuntu is 'x86_64-linux-gnu-*' (without '-pc').
$ grep cros_host out_x86-alex/Release/args.gn
cros_host_ar = "x86_64-pc-linux-gnu-ar"
cros_host_extra_cxxflags = ""
cros_host_extra_ldflags = ""
cros_host_extra_cflags = ""
cros_host_is_clang = false
cros_host_cc = "x86_64-pc-linux-gnu-gcc"
cros_host_cxx = "x86_64-pc-linux-gnu-g++"
cros_host_ld = "x86_64-pc-linux-gnu-g++"
Removing '-pc' from
out_x86-alex/Release/args.gn resolved that issue.
I guess this is due to a difference between Gentoo-based chroot (that is used as the host environment for building chrome os) and Ubuntu because $GN_ARGS comes from the chroot (as shown below)
cros chrome-sdk --board=$BOARD --chroot=/w/cros/t/chroot
16:05:46: NOTICE: Environment fetched from: /w/cros/t/chroot/build/x86-alex/var/db/pkg/chromeos-base/chromeos-chrome-53.0.2757.0_rc-r2/environment.bz2