error: undefined reference to 'dlsym' if building with ASan and GCC (Tor 17509)
Categories
(Firefox Build System :: General, defect, P3)
Tracking
(Not tracked)
People
(Reporter: gk, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [tor][tor-standalone])
Attachments
(1 file)
53.80 KB,
text/plain
|
Details |
Reporter | ||
Comment 1•9 years ago
|
||
Reporter | ||
Comment 2•9 years ago
|
||
Reporter | ||
Comment 3•9 years ago
|
||
Reporter | ||
Comment 5•9 years ago
|
||
Comment 6•9 years ago
|
||
Reporter | ||
Comment 7•9 years ago
|
||
Comment 8•9 years ago
|
||
Reporter | ||
Comment 9•9 years ago
|
||
Comment 10•9 years ago
|
||
Reporter | ||
Comment 11•9 years ago
|
||
Comment 12•9 years ago
|
||
Comment 13•9 years ago
|
||
Comment 14•9 years ago
|
||
Comment 15•8 years ago
|
||
Updated•8 years ago
|
Updated•8 years ago
|
Updated•8 years ago
|
Reporter | ||
Comment 17•8 years ago
|
||
Reporter | ||
Updated•8 years ago
|
Comment 20•7 years ago
|
||
Reporter | ||
Comment 21•7 years ago
|
||
Updated•7 years ago
|
I am afraid this problem may be back.
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/mozglue/misc/StackWalk.cpp:794: error: undefined reference to 'dladdr'
and several other places.
Oh, wait. I am getting this error WITH ordinary build using GCC, not ASAN build (!)
(In reply to ISHIKAWA, Chiaki from comment #22)
I am afraid this problem may be back.
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/mozglue/misc/StackWalk.cpp:794: error: undefined reference to 'dladdr'
and several other places.
Oh, wait. I am getting this error WITH ordinary build using GCC, not ASAN build (!)
I added
# suddenly dlopen link fails. Aug 17, 2022 (maybe after apg-get dist-upgrade)
export LDFLAGS="-dl"
to my MOZCONFIG, and it solved many l errors except for the following errors that still remain.
gmake[4]: Leaving directory '/NEW-SSD/moz-obj-dir/objdir-tb3/xpcom/tests'
gmake[4]: Entering directory '/NEW-SSD/moz-obj-dir/objdir-tb3/security/manager/ssl/ipcclientcerts'
security/manager/ssl/ipcclientcerts/force-cargo-library-build
/home/ishikawa/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo rustc --offline --manifest-path /NEW-SSD/NREF-COMM-CENTRAL/mozilla/security/manager/ssl/ipcclientcerts/Cargo.toml -vv --color=always --lib --target=x86_64-unknown-linux-gnu --
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/nsprpub/pr/src/linking/prlink.c:97: error: undefined reference to 'dlerror'
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/nsprpub/pr/src/linking/prlink.c:783: error: undefined reference to 'dlsym'
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/nsprpub/pr/src/malloc/prmem.c:99: error: undefined reference to 'dlopen'
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/nsprpub/pr/src/malloc/prmem.c:103: error: undefined reference to 'dlsym'
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/nsprpub/pr/src/malloc/prmem.c:104: error: undefined reference to 'dlclose'
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/nsprpub/pr/src/linking/prlink.c:960: error: undefined reference to 'dladdr'
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/nsprpub/pr/src/linking/prlink.c:140: error: undefined reference to 'dlopen'
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/nsprpub/pr/src/linking/prlink.c:584: error: undefined reference to 'dlopen'
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/nsprpub/pr/src/linking/prlink.c:676: error: undefined reference to 'dlclose'
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/nsprpub/pr/src/pthreads/ptthread.c:1696: error: undefined reference to 'dlsym'
collect2: error: ld returned 1 exit status
gmake[4]: *** [/NEW-SSD/NREF-COMM-CENTRAL/mozilla/config/rules.mk:540: libnspr4.so] Error 1
gmake[4]: Leaving directory '/NEW-SSD/moz-obj-dir/objdir-tb3/config/external/nspr/pr'
gmake[3]: *** [/NEW-SSD/NREF-COMM-CENTRAL/mozilla/config/recurse.mk:72: config/external/nspr/pr/target] Error 2
gmake[3]: *** Waiting for unfinished jobs....
I have upgraded Debian GNU/linux packages before the source tree update, and that may have something to do with
the issue. More investigation continues.
Again, I had a problem today with non-ASAN build with gcc-10.
Adding -ldl on CFLAGS, and CXXFLAGS as in the case of ASAN fixed the issue.
But it was not necessary for a LONG TIME.
Relevant part from my shell script to invoke |mach build|, etc. after setting up various environment variables.
# ASAN=-fsanitize=address -ldl
# We need -ldl even for non-asan build?
ASAN=-ldl # <---- NEW
#
#
# -fPIC -mcmodel=large caused cpuid() asm definition in
# mozilla/media/libvpx/vpx_ports/x86.h to blow up.
#
# see the discussion in https://gcc.gnu.org/ml/gcc-patches/2012-12/msg01484.html
# But I don't understand the GCC in-line asm of late.
#
MEMORYMODEL="-fPIC -mcmodel=large"
MEMORYMODEL="-mcmodel=large"
MEMORYMODEL=
# July, 2015 after gtk+-3 (?)
# MEMORYMODEL=-fPIC
# Again in Jan 2016 when
# /usr/local/bin/ld: error: /NREF-COMM-CENTRAL/objdir-tb3/toolkit/library/../../mailnews/import/src/nsImportScanFile.o: requires dynamic R_X86_64_PC32 reloc against '_Z15FullyReadStreamP14nsIInputStreamPvjPj' which may overflow at runtime; recompile with -fPIC
#
# MEMORYMODEL=-fPIC
# undefine DEBUG
# April 23, 2016
# break CC Macro into main CC macro for binary and CFLAGS
#
# added -Werror=sign-compare on Sept 15, 2016
# added -Werror=unused-result on Sept 22, 2016
WARNFLAGS="-Werror=sign-compare -Werror=unused-result -Werror=unused-variable -Werror=format"
NULLPTRCHK=-fno-delete-null-pointer-checks
NULLPTRCHK=
# took out -DDEBUG=1 from the command line on Jan 24, 2014
# but it is obviously back as -DDEBUG in CFLAGS.
#
SPLITDWARF=-gsplit-dwarf
SPLITDWARF=
export CFLAGS="$CFLAGS $MEMORYMODEL $ASAN -fno-builtin-strlen -Dfdatasync=fdatasync -DDEBUG_4GB_CHECK -DUSEHELGRIND=1 -DUSEVALGRIND=1 -DDEBUG $NULLPTRCHK -g ${SPLITDWARF} ${WARNFLAGS} -fuse-ld=gold"
export CXXFLAGS="$CXXFLAGS $MEMORYMODEL $ASAN -fno-builtin-strlen -Dfdatasync=fdatasync -DDEBUG_4GB_CHECK -DUSEHELGRIND=1 -DUSEVALGRIND=1 -DDEBUG $NULLPTRCHK -g ${SPLITDWARF} ${WARNFLAGS} -fuse-ld=gold"
... eventually |mach "$*" | is invoked.
Updated•2 years ago
|
Comment 25•2 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Description
•