public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/51720] New: Build issue. stage1 ldflags not correctly used
@ 2011-12-30 21:09 ramon.garcia.freesw at gmx dot com
  2011-12-30 21:11 ` [Bug other/51720] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ramon.garcia.freesw at gmx dot com @ 2011-12-30 21:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51720

             Bug #: 51720
           Summary: Build issue. stage1 ldflags not correctly used
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ramon.garcia.freesw@gmx.com


In order to build GCC with shared libraries libcloog and libppl, that have been
previously installed in /opt/gcc-4.6/lib, one executes configure with the
following options

../gcc-4.6.2/configure --prefix=/opt/gcc-4.6 --with-ppl=/opt/gcc-4.6
--with-cloog=/opt/gcc-4.6 --enable-gold --enable-languages=c,c++,ada,fortran,go
-with-stage1-ldflags="-Wl,-rpath=/opt/gcc-4.6/lib -static-libgcc
-static-libstdc++" --with-boot-ldflags="-Wl,-rpath=/opt/gcc-4.6/lib 
-static-libgcc -static-libstdc++"

But the compiler built in the stage1 phase does not find libppl and libcloog:

> ./gcc/cc1
./gcc/cc1: error while loading shared libraries: libcloog.so.0: cannot open
shared object file: No such file or directory

becuase the stage1 ldflags are not correctly passed

The issue comes from the top level Makefile. The invocation of the stage1 build
correctly passes stage1 ldflags as part of the HOST_EXPORTS. But in the submake
invocation, it also passes $(BASE_FLAGS_TO_PASS), that sets LDFLAGS to empty,
and has higher priority.


.PHONY: all-stage1-gcc maybe-all-stage1-gcc
.PHONY: clean-stage1-gcc maybe-clean-stage1-gcc
maybe-all-stage1-gcc:
maybe-clean-stage1-gcc:
maybe-all-stage1-gcc: all-stage1-gcc
all-stage1: all-stage1-gcc
TARGET-stage1-gcc = $(TARGET-gcc)
all-stage1-gcc: configure-stage1-gcc
        @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        TFLAGS="$(STAGE1_TFLAGS)"; \
        $(HOST_EXPORTS)  \
        cd $(HOST_SUBDIR)/gcc && \
        $(MAKE) $(BASE_FLAGS_TO_PASS) \
                CFLAGS="$(STAGE1_CFLAGS)" \
                CXXFLAGS="$(STAGE1_CXXFLAGS)" \
                LIBCFLAGS="$(LIBCFLAGS)" \
                CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
                CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
                LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
                $(EXTRA_HOST_FLAGS)  $(EXTRA_GCC_FLAGS) \
                TFLAGS="$(STAGE1_TFLAGS)" \
                $(TARGET-stage1-gcc)


Suggestions:

a) include LDFLAGS="$(STAGE1_LDFLAGS)" in this invocation

b) remove LDFLAGS from BASE_FLAGS_TO_PASS, and include it everywhere it may be
needed. So LDFLAGS setting from HOST_EXPORTS will take priority


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-30 23:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-30 21:09 [Bug other/51720] New: Build issue. stage1 ldflags not correctly used ramon.garcia.freesw at gmx dot com
2011-12-30 21:11 ` [Bug other/51720] " jakub at gcc dot gnu.org
2011-12-30 23:25 ` ramon.garcia.freesw at gmx dot com
2011-12-30 23:32 ` ramon.garcia.freesw at gmx dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).