This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
Building gcc4-4.3.0-20070518 failed on OSX 10.3.9. Copies of http://gcc.gnu.org/ml/gcc/2007-05/msg00483.html > Comparing the log of successful and failed builds I have found > that the failed one contains -mdynamic-no-pic which does not > appear in the previous build. According Apple's doc this > should be used in "application", but it should not appear > when building libraries (at least it is my understanding). > > I suspect the origin of the problem comes from > > 2007-05-16 Paolo Bonzini <bonzini@gnu.org> > > * Makefile.def (bootstrap_stage): Replace stage_make_flags with > stage_cflags. > * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS, POSTSTAGE1_FLAGS_TO_PASS): > Remove CFLAGS/LIBCFLAGS. > (configure-stage[+id+]-[+prefix+][+module+], > all-stage[+id+]-[+prefix+][+module+]): Pass it from [+stage_cflags+]. > * Makefile.in: Regenerate. > > but there are too many changes to allow me to go further. > > BTW I also noticed the nicety > > ... -O2 -O2 -g -O2 ... -g -O2 ... > > (was ... -O2 -O2 -g -O2 ... -O2 -g -O2 ...) http://gcc.gnu.org/ml/gcc/2007-05/msg00485.html form Andreas Tobler > Thanks Dominique, I just reverted this patch to see if I get further. > I have the same problem on 10.4.9 and was to lazy to investigate > that deep as you did. > I'll let you know how it works. > > In toplevel, svn up -r 124763 Makefile.tpl Makefile.def Makefile.in and http://gcc.gnu.org/ml/gcc/2007-05/msg00487.html > > In toplevel, svn up -r 124763 Makefile.tpl Makefile.def Makefile.in > > I used the files from trunk revision 124627 and the build went fine. > > I'll try to find some time to fill a PR
I know what's going on :-)
Created an attachment (id=13593) [edit] tentative patch? Please test this patch.
Sorry about the bad news, but I still have the very same failure with the patch: # @multilib_dir@ is not really necessary, but sometimes it has # more uses than just a directory name. /bin/sh ../../../gcc-4.3-20070519/libgcc/../mkinstalldirs . /sw/src/fink.build/gcc4-4.3.0-20070519/darwin_objdir/./gcc/xgcc -B/sw/src/fink.build/gcc4-4.3.0-20070519/darwin_objdir/./gcc/ -B/sw/lib/gcc4/powerpc-apple-darwin7/bin/ -B/sw/lib/gcc4/powerpc-apple-darwin7/lib/ -isystem /sw/lib/gcc4/powerpc-apple-darwin7/include -isystem /sw/lib/gcc4/powerpc-apple-darwin7/sys-include -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -Wa,-force_cpusubtype_ALL -pipe -mmacosx-version-min=10.4 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -dynamiclib -nodefaultlibs -install_name /sw/lib/gcc4/lib/libgcc_s`if test . = ppc64 ; then echo _. ; fi`.1.dylib -single_module -o ./libgcc_s.1.dylib.tmp -Wl,-exported_symbols_list,libgcc.map -compatibility_version 1 -current_version 1.0 -g -O2 -mdynamic-no-pic -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _enable_execute_stack_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixtfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _fixunstfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatditf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _floatunditf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o darwin-tramp_s.o ppc64-fp_s.o darwin-64_s.o darwin-ldouble_s.o darwin-world_s.o unwind-dw2_s.o unwind-dw2-fde-darwin_s.o unwind-sjlj_s.o unwind-c_s.o darwin-fallback_s.o emutls_s.o -lc /sw/lib/odcctools/bin/ld: warning -dylib_install_name /sw/lib/gcc4/lib/libgcc_s.1.dylib not found in segment address table LD_SEG_ADDR_TABLE /sw/var/lib/fink/prebound/seg_addr_table /sw/lib/odcctools/bin/ld: _enable_execute_stack_s.o has local relocation entries in non-writable section (__TEXT,__text) collect2: ld returned 1 exit status make[3]: *** [libgcc_s.dylib] Error 1 make[2]: *** [all-stage2-target-libgcc] Error 2 make[1]: *** [stage2-bubble] Error 2 make: *** [all] Error 2 Apparently '-mdynamic-no-pic' is hiding somewhere it is not expected.
Nope. It clinches somehow with this one: config/mh-ppc-darwin. Here the BOOT_CFLAGS is set to -g -O2 -mdynamic-no-pic. In the libgcc Makefile.in I see that MULTILIB_CFLAGS is set to CFLAGS + extra stuff. CFLAGS itself is BOOT_CFLAGS, so the -mdynamic-no-pic in a shared lib :) I'll see if I understand a bit more later. Thanks!
Late night comment, Paolo, I think your patch is fine but it exposed an inconsitency in using CFLAGS/BOOT_CFLAGS in libgcc. I could work around the problem with filtering out the mdynamic-no-pic inside the libgcc Makefile.in.: Index: Makefile.in =================================================================== --- Makefile.in (revision 124895) +++ Makefile.in (working copy) @@ -204,7 +204,7 @@ # Forcibly remove any profiling-related flags. There is no point # in supporting profiled bootstrap in this library. -override CFLAGS := $(filter-out -fprofile-generate -fprofile-use,$(CFLAGS)) +override CFLAGS := $(filter-out -fprofile-generate -fprofile-use -mdynamic-no-pic,$(CFLAGS)) # CFLAGS first is not perfect; normally setting CFLAGS should override any # options in LIBGCC2_CFLAGS. But LIBGCC2_CFLAGS may contain -g0, and CFLAGS It's absolutely the wrong place with the wrong comment. But it's ok for a first trial. It smells for me to have an additional var and to pass this one correctly to all involved consumers. As said, late night.
Please try this patch on top of the previous one. Its purpose is just to validate the logic of the previous one, it's not meant to be committed. Index: libgcc/configure.ac =================================================================== --- libgcc/configure.ac (revision 124764) +++ libgcc/configure.ac (working copy) @@ -100,6 +100,8 @@ GCC_NO_EXECUTABLES AC_PROG_CC AC_PROG_CPP_WERROR +CFLAGS=$LIBCFLAGS + # Check for decimal float support. AC_CACHE_CHECK([whether decimal floating point is supported], [libgcc_cv_dfp], [AC_COMPILE_IFELSE([_Decimal32 x;], [libgcc_cv_dfp=yes],
> Please try this patch on top of the previous one. Sorry, bad news again: I got the same failure (still have -mdynamic-no-pic).
I have a Mac so I can fix this, but I'm not sure on the timing. I'm commenting out the BOOT_CFLAGS setting for a moment to unbreak bootstrap.
Subject: Bug 32009 Author: bonzini Date: Wed May 23 14:26:31 2007 New Revision: 124990 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124990 Log: 2007-05-23 Paolo Bonzini <bonzini@gnu.org> PR bootstrap/32009 * mh-ppc-darwin: Temporarily disable. Modified: trunk/config/ChangeLog trunk/config/mh-ppc-darwin
> I have a Mac so I can fix this, but I'm not sure on the timing. > I'm commenting out the BOOT_CFLAGS setting for a moment to unbreak bootstrap. I'll give a try tonight, but it should work (I am not sure to believe the 3-5% on compile time, I'll see!-). Thanks
With the last patch the build passed the critical point!-) I'll have the full build tomorrow morning (Paris time). Thanks
build completed. As expected.
For me too.
I have run what I can of the testsuite (gcc, g++, gfortran, and objc) without regression. I have also run my version of the polyhedron tests and got: with Makefile.*'s from revision 124627 1891.060u 84.040s 33:15.89 98.9% with original revision + all the patches 1933.980u 88.770s 34:23.23 98.0% 0+0k 14+429io 0pf+0w so an average solwdown of ~2.4%. slightly below the estimate from the comment: "This fix speeds compiles by 3-5%". This seems evenly distibuted between compile and execution times and between the different cases, though this is only a visual impression and not a careful check (I can do it if there is any interest).
Can this now be closed?
No, we shouldn't close it until we can get the compiler building on ppc with -mdynamic-no-pic.
And that's why I left it assigned to me. I'll work on it next week.
*** Bug 32161 has been marked as a duplicate of this bug. ***
I have a patch, I'll get around to testing it next week, promised. :-)
"Next week" has come and gone... News?
P1 blocker regression for GCC 4.3, and no activity for 3 months. PING! Either someone at Apple or Paolo should show some activity here. Otherwise we might as well close this as WONTFIX, assuming it is apparently not important enough for anyone to spend some time on. Mark, is there a policy to downgrade bug severities if something is marked as a P1 blocker bug, but apparently nobody thinks it is important enough to fix it quickly?
:-(
You're perfectly right; OTOH if I hadn't meant to fix it, I would have unassigned it. Sometimes people are busy, and for a build patch I usually do more than bootstrap/regtest on one architecture.
Bootstrap is unbroken, lowering severity.
> Bootstrap is unbroken, lowering severity. What did you mean exactly here? :-) Severity is still "blocker".
patch at http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00775.html
Subject: Bug 32009 Author: bonzini Date: Wed Feb 20 14:10:40 2008 New Revision: 132479 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132479 Log: 2008-02-20 Paolo Bonzini <bonzini@gnu.org> PR bootstrap/32009 PR bootstrap/32161 * configure.ac (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Compute here. * configure: Regenerate. * Makefile.def: Define stage_libcflags for all bootstrap stages. * Makefile.tpl (STAGE1_LIBCFLAGS, STAGE2_LIBCFLAGS, STAGE3_LIBCFLAGS, STAGE4_LIBCFLAGS): New. (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Subst from autoconf, without $(SYSROOT_CFLAGS_FOR_TARGET) and $(DEBUG_PREFIX_CFLAGS_FOR_TARGET). (BASE_TARGET_EXPORTS): Append them here to C{,XX}FLAGS. (EXTRA_TARGET_FLAGS): Append them here to {LIB,}C{,XX}FLAGS. (configure-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags for target modules. Don't export LIBCFLAGS. (all-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags; pass $(BASE_FLAGS_TO_PASS) where [+args+] was passed, and [+args+] after the overridden CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. (invocations of `all'): Replace $(TARGET_FLAGS_TO_PASS) with $(EXTRA_TARGET_FLAGS), $(FLAGS_TO_PASS) with $(EXTRA_HOST_FLAGS). * Makefile.in: Regenerate. 2008-02-20 Paolo Bonzini <bonzini@gnu.org> PR bootstrap/32009 * mh-ppc-darwin (BOOT_CFLAGS): Reenable. 2008-02-20 Paolo Bonzini <bonzini@gnu.org> * doc/install.texi: Correct references to CFLAGS, replacing them with BOOT_CFLAGS. Document flags used during bootstrap for target libraries. Modified: trunk/ChangeLog trunk/Makefile.def trunk/Makefile.in trunk/Makefile.tpl trunk/config/ChangeLog trunk/config/mh-ppc-darwin trunk/configure trunk/configure.ac trunk/gcc/ChangeLog trunk/gcc/doc/install.texi
Thanks.
Paolo, thank you. It took me some time but now I completed a bootstrap on ppc-darwin (10.5.2). I started to try your first patch yesterday and I failed due to some predict.c failure. This morning I restarted and interrupted after I saw your second patch. Tried this one as well and I failed. I must have missed an autoconf step and as it seemed, also a Makefile generation step. After your commit I felt very bad. But then, before complaining, I synced and restarted the build again. Whee, success! As already said, thank you! Andreas
Fixed(?). Please re-open if not.
It works at least on the trunk.
Yes, I don't remember if it was committed before or after the branchpoint... :-(