This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Strange ld.gold segmentation error issues.
- From: "ISHIKAWA,chiaki" <ishikawa at yk dot rim dot or dot jp>
- To: Cary Coutant <ccoutant at google dot com>, Binutils <binutils at sourceware dot org>
- Date: Thu, 05 Jun 2014 22:14:48 +0900
- Subject: Re: Strange ld.gold segmentation error issues.
- Authentication-results: sourceware.org; auth=none
- References: <537A2682 dot 40706 at yk dot rim dot or dot jp> <538A0A46 dot 2030102 at yk dot rim dot or dot jp> <CAHACq4qrW+so6g5mvU3hrNgxAJWRerfDrCB=ceECJyadsJQeaA at mail dot gmail dot com> <538F30D0 dot 1010409 at yk dot rim dot or dot jp> <538F344E dot 9020404 at yk dot rim dot or dot jp>
Hi,
I think my suspicion that there are environment variables passed to
the environment when the LD (GNU gold) is invoked from GCC
is correct.
I compared the output of
env | sort
under ordinary shell, and
its output when /usr/bin/ld.new (GNU gold on my system) is inovked.
Then I found the differences and I picked up what I think are the
relevant ones below.
I think COLLECT_LTO_WRAPPER is for the link-time optimization. But I
didn't realizee it was in effect, or was it?.
Maybe if I set these when I run GNU gold manually I get the
segmentation fault. I will investigate more.
I didn't know that there are so many interactions between compiler and
linker during compilation.
TIA
--- excerpt from the diff of "env | sort" under ordinary shell, and
when ld was invoked from GCC.
+CL_INCLUDES_PREFIX=
+COLLECT_GCC=/usr/bin/g++-4.8
+COLLECT_GCC_OPTIONS='-fno-builtin-strlen' '-D' 'fdatasync=fdatasync'
'-D' 'DEBUG=1' '-D' 'DEBUG_4GB_CHECK' '-D' 'USEHELGRIND=1' '-o' 'js'
'-Wall' '-Wpointer-arith' '-Woverloaded-virtual' '-Werror=return-type'
'-Werror=int-to-pointer-cast' '-Wtype-limits' '-Wempty-body'
'-Werror=conversion-null' '-Wsign-compare' '-Wno-invalid-offsetof'
'-Wcast-align' '-fno-rtti' '-fno-exceptions' '-fno-math-errno'
'-std=gnu++11' '-pthread' '-pipe' '-D' 'DEBUG' '-D' '_DEBUG' '-D'
'TRACING' '-gsplit-dwarf' '-g' '-O2' '-freorder-blocks'
'-fno-omit-frame-pointer' '-L../../../dist/bin' '-L../../../dist/lib'
'-L/REF-OBJ-DIR/objdir-tb3/mozilla/dist/lib' '-rdynamic'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
+COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/
!LD_LIBRARY_PATH=/COMM-CENTRAL/objdir-tb3/mozilla/media/libsoundtouch/src/:/COMM-CENTRAL/objdir-tb3/mozilla/media/libsoundtouch/src/::/usr/local/lib:/usr/local/lib
The above is changed slightly under mozilla thunderbird build, but may not
mean much.
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../:/lib/:/usr/lib/
The above looks important.
The followings are set by mozilla thunderbird build infrastructure.
+MAKEFLAGS=rs -j --jobserver-fds=4,5
+MAKELEVEL=6
+MFLAGS=-rs -j --jobserver-fds=4,5
+MOZ_SOURCE_STAMP=c5d1f5c18591
+NONASCII=
I have no idea what the above is for. Maybe mozilla thunderbird build
infrastructure sets this.
+TOPLEVEL_BUILD=1
+UNCACHED_ERR_FD=5
[end of memo]