Fwd: Simple Chrome: ld.gold error: -warn-poison-system-directories

52 views
Skip to first unread message

Jungshik Shin (신정식, 申政湜)

unread,
Jun 12, 2016, 1:47:12 AM6/12/16
to Chromium OS dev

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

 



Jungshik Shin (신정식, 申政湜)

unread,
Jun 12, 2016, 4:00:47 AM6/12/16
to Chromium OS dev
2016-06-11 22:47 GMT-07:00 Jungshik Shin (신정식, 申政湜) <js...@chromium.org>:

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')  

Just in case, I tried  'deprecated' GYP procedure. And, it worked flawlessly ! I took a look at the top-level ninja file and found the following:

cc = /usr/local/google/w/cr/t/.cros_cache/common/goma+2/gomacc i686-pc-linux-gnu-gcc $
    -B/usr/local/google/w/cr/t/.cros_cache/chrome-sdk/tarballs/x86-alex+8329.0.0+target_toolchain/usr/x86_64-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.25.51-gold
cxx = /usr/local/google/w/cr/t/.cros_cache/common/goma+2/gomacc 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-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.25.51-gold
ld = $cc
ldxx = $cxx
ar = i686-pc-linux-gnu-ar
nm = nm
readelf = readelf
ar_host = ar
nm_host = nm
readelf_host = readelf
cc_host = /usr/local/google/w/cr/t/.cros_cache/common/goma+2/gomacc $
    /usr/local/google/w/cr/t/src/third_party/llvm-build/Release+Asserts/bin/clang
cxx_host = /usr/local/google/w/cr/t/.cros_cache/common/goma+2/gomacc $
    /usr/local/google/w/cr/t/src/third_party/llvm-build/Release+Asserts/bin/clang++
ld_host = $cc_host
ldxx_host = $cxx_host

 Anyway, I do want to use GN if I can resolve the issue I came across. 
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages