Closed
Bug 240267
Opened 20 years ago
Closed 16 years ago
Link error when doing "make profiledbuild"
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bjackson0971, Assigned: ted)
Details
Attachments
(1 file, 1 obsolete file)
4.43 KB,
patch
|
benjamin
:
review+
sayrer
:
approval1.9+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040411 Firefox/0.8.0+ Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040411 Firefox/0.8.0+ I tried to do a Firefox profiledbuild with GCC 3.4.0 20040407 (prerelease) and I get this. gcc -I/usr/X11R6/include -Wall -W -Wno-unused -Wpointer-arith-Wcast-align -Wno-long-long -pedantic -pthread -pipe -DNDEBUG -DTRIMMED-ffunction-sections -O2 -pipe -march=pentium2 -o xpt_dump xpt_dump.o -L../../../../dist/bin -L../../../../dist/lib../../../../dist/lib/libxpt.a -ldl -lm xpt_dump.o(.data+0x264): undefined reference to `__gcov_merge_add'xpt_dump.o(.text._GLOBAL__I_param_problems_GCOV+0xe): In function`global constructors keyed to param_problems_GCOV':: undefined reference to `__gcov_init'collect2: ld returned 1 exit statusgmake[7]: *** [xpt_dump] Error 1 E-mail correspondence with Brian Ryner suggested that -fprofile-generate needs to be passed to gcc during the link of profiled builds with GCC 3.4. This will apparently cause -lgcov to be passed to ld so we link against libgcov. Reproducible: Always Steps to Reproduce: 1. If you don't have GCC 3.4, download ftp://gcc.gnu.org/pub/gcc/snapshots/3.4-20040407/gcc-3.4-20040407.tar.bz2 2. ./configure --prefix=/usr/gcc34-20040407 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-long-long --with-system-zlib --enable-languages=c,c++ && make bootstrap 3. su -c "make install" 4. I usually have to run ldconfig /usr/gcc34-20040407/lib before the firefox binary will run 5. I have a shell script that does: export PATH=/usr/gcc34-20040407/bin:$PATH and then runs: make -f client.mk checkout make -f client.mk profiledbuild Actual Results: gcc -I/usr/X11R6/include -Wall -W -Wno-unused -Wpointer-arith-Wcast-align -Wno-long-long -pedantic -pthread -pipe -DNDEBUG -DTRIMMED-ffunction-sections -O2 -pipe -march=pentium2 -o xpt_dump xpt_dump.o -L../../../../dist/bin -L../../../../dist/lib../../../../dist/lib/libxpt.a -ldl -lm xpt_dump.o(.data+0x264): undefined reference to `__gcov_merge_add'xpt_dump.o(.text._GLOBAL__I_param_problems_GCOV+0xe): In function`global constructors keyed to param_problems_GCOV':: undefined reference to `__gcov_init'collect2: ld returned 1 exit statusgmake[7]: *** [xpt_dump] Error 1 Expected Results: Expect binary to link and build to finish
Comment 1•19 years ago
|
||
Is this still an issue?
Comment 2•19 years ago
|
||
(In reply to comment #1) > Is this still an issue? Yeah; I ran into this while trying to compile from source on Gentoo: gcc -o now.o -c -pipe -ansi -Wall -pthread -O2 -fprofile-generate -fPIC -UDEBUG -DMOZILLA_CLIENT=1 -DNDEBUG=1 -DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 -DHAVE_VISIBILITY_PRAGMA=1 -DXP_UNIX=1 -D_POSIX_SOURCE=1 -D_BSD_SOURCE=1 -D_SVID_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_FCNTL_FILE_LOCKING=1 -DLINUX=1 -Di386=1 -DHAVE_LCHOWN=1 -DHAVE_STRERROR=1 -D_REENTRANT=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM now.c gcc now.o -o now now.o: In function `global constructors keyed to main_GCOV': now.c:(.text+0xbc): undefined reference to `__gcov_init' now.o:(.data.rel+0x24): undefined reference to `__gcov_merge_add' collect2: ld returned 1 exit status gmake[4]: *** [now] Error 1 gmake[4]: Leaving directory `/home/preed/checkouts/MOZILLA_1_8_BRANCH/mozilla/nsprpub/config' gmake[3]: *** [export] Error 2 gmake[3]: Leaving directory `/home/preed/checkouts/MOZILLA_1_8_BRANCH/mozilla/nsprpub' gmake[2]: *** [nspr] Error 2 gmake[2]: Leaving directory `/home/preed/checkouts/MOZILLA_1_8_BRANCH/mozilla' make[1]: *** [default] Error 2 make[1]: Leaving directory `/home/preed/checkouts/MOZILLA_1_8_BRANCH/mozilla' make: *** [profiledbuild] Error 2 If I leave out the -fgenerate-profile, then it will just die later with the missing symbols reported while trying to compile one of the xpt tools. [preed@preed-lx mozilla]$ gcc -v Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/specs Configured with: /var/tmp/portage/gcc-3.4.4-r1/work/gcc-3.4.4/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4.4 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/g++-v3 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libgcj --enable-languages=c,c++,f77 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Link error when doing "make profiledbuild" with GCC 3.4 → Link error when doing "make profiledbuild" with GCC 3.4 (missing -lgcov)
Comment 3•19 years ago
|
||
This tacks on -fprofile-generate to the link lines as well, as discussed in comment 0, however I'm not sure whether or not this is the best fix. I'm also not sure whether it breaks GCC 3.3 (didn't have a chance to test with 3.3 yet). I know it fixes 3.4. I'm leaning towards explicitely adding the -lgcov library to LIBS, since technically -fprofile-generate isn't a valid LDFLAG. I'll report back with GCC 3.3 when I have a chance.
Comment 4•19 years ago
|
||
Just finished testing this patch with GCC 3.3.6/binutils 2.15.x; works there, too: [preed@underworld mozilla]$ gcc -v Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/specs Configured with: /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.6 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/info --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include/g++-v3 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-nls --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,f77 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8) [preed@underworld mozilla]$ ld -v GNU ld version 2.15.92.0.2 20040927 [preed@underworld mozilla]$ If this is the right fix, then we can decide whether it should land on the trunk and (possibly) the 1.8.0 branch; don't know how necessary profiled builds there are (or if we're running into this there).
Updated•18 years ago
|
Assignee: bryner → nobody
QA Contact: asa → build.config
Version: unspecified → Trunk
Assignee | ||
Comment 5•16 years ago
|
||
Going to make this work again, but I'm aiming for GCC4, not 3.4, since that's what we build with on the tinderbox.
Assignee: nobody → ted.mielczarek
Summary: Link error when doing "make profiledbuild" with GCC 3.4 (missing -lgcov) → Link error when doing "make profiledbuild"
Assignee | ||
Comment 6•16 years ago
|
||
Not really concerned about gcc 3.4 nowadays. This patch lets me build with gcc 4.1. (Should work fine with gcc 4.0.4 on our refplatform.)
Attachment #207032 -
Attachment is obsolete: true
Attachment #303308 -
Flags: review?(benjamin)
Updated•16 years ago
|
Attachment #303308 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 7•16 years ago
|
||
Comment on attachment 303308 [details] [diff] [review] make profiledbuild work with gcc4 This is required for PGO work.
Attachment #303308 -
Flags: approval1.9?
Updated•16 years ago
|
Attachment #303308 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 8•16 years ago
|
||
Checked in. Forgot to include the diff to config/autoconf.mk.in in this patch, but obviously I added there what I added in configure.in. Also, I added OS_CXXFLAGS += $(PROFILE_{GEN,USE}_CFLAGS) lines in config.mk.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Component: Build Config → General
Product: Firefox → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•