Bug 12903 - Makefile install target for libibert assumes gcc
Summary: Makefile install target for libibert assumes gcc
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: build (show other bugs)
Version: 7.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-16 20:12 UTC by tim.mooney
Modified: 2018-09-26 18:16 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tim.mooney 2011-06-16 20:12:09 UTC
I'm building gdb-7.2 on x86_64-sun-solaris2.10 (Solaris 10u6, not OpenSolaris) with the Sun Workshop 12 u1 compiler toolchain.

The Makefile.in for libiberty just assumes that gcc is going to be used to build everything, as it hardcodes ``-print-multi-os-directory'' into the install flags for libiberty.  This obviously doesn't work for Sun's "cc":

gmake[2]: Entering directory `/local/src/RPM/BUILD/gdb-7.2/libiberty'
gmake[3]: Entering directory `/local/src/RPM/BUILD/gdb-7.2/libiberty/testsuite'
gmake[3]: Nothing to be done for `all'.
gmake[3]: Leaving directory `/local/src/RPM/BUILD/gdb-7.2/libiberty/testsuite'
/bin/bash ./../mkinstalldirs /tmp/build/gdb/local/gnu/lib/64/`cc -Xa -xs -g -xta
rget=native -m64 -xarch=native -I/local/gnu/include -I/local/gnu/include -I/loca
l/include -print-multi-os-directory`
cc: Warning: Option -nt-multi-os-directory passed to ld, if ld is invoked, ignor
ed otherwise
usage: cc [ options] files.  Use 'cc -flags' for details
/local/gnu/bin/ginstall -c -m 644 ./libiberty.a /tmp/build/gdb/local/gnu/lib/64/
`cc -Xa -xs -g -xtarget=native -m64 -xarch=native -I/local/gnu/include -I/local/
gnu/include -I/local/include -print-multi-os-directory`/./libiberty.an
cc: Warning: Option -nt-multi-os-directory passed to ld, if ld is invoked, ignor
ed otherwise
usage: cc [ options] files.  Use 'cc -flags' for details
( cd /tmp/build/gdb/local/gnu/lib/64/`cc -Xa -xs -g -xtarget=native -m64 -xarch=
native -I/local/gnu/include -I/local/gnu/include -I/local/include -print-multi-o
s-directory` ; chmod 644 ./libiberty.an ;ranlib ./libiberty.an )
cc: Warning: Option -nt-multi-os-directory passed to ld, if ld is invoked, ignor
ed otherwise
usage: cc [ options] files.  Use 'cc -flags' for details
mv -f /tmp/build/gdb/local/gnu/lib/64/`cc -Xa -xs -g -xtarget=native -m64 -xarch
=native -I/local/gnu/include -I/local/gnu/include -I/local/include -print-multi-
os-directory`/./libiberty.an /tmp/build/gdb/local/gnu/lib/64/`cc -Xa -xs -g -xta
rget=native -m64 -xarch=native -I/local/gnu/include -I/local/gnu/include -I/loca
l/include -print-multi-os-directory`/./libiberty.a
cc: Warning: Option -nt-multi-os-directory passed to ld, if ld is invoked, ignor
ed otherwise
usage: cc [ options] files.  Use 'cc -flags' for details
cc: Warning: Option -nt-multi-os-directory passed to ld, if ld is invoked, ignor
ed otherwise
usage: cc [ options] files.  Use 'cc -flags' for details


This was not a problem in gdb-7.0.1.  I never tried gdb-7.1, so I don't know if the problem was present there or not.
Comment 1 Pedro Alves 2011-06-17 09:11:35 UTC
Diffing 7.0's and 7.2's Makefile.in.

--- /home/pedro/gdb/7_0/src/libiberty/Makefile.in       2011-01-13 10:31:59.628963997 +0000
+++ /home/pedro/gdb/7_2/src/libiberty/Makefile.in       2011-01-13 10:44:23.278964001 +0000
@@ -101,7 +101,7 @@ SUBDIRS = testsuite
 
 # FIXME: add @BUILD_INFO@ once we're sure it works for everyone.
 all: stamp-picdir $(TARGETLIB) required-list all-subdir
-       @: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
+       @: $(MAKE) ; $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
 
 .PHONY: check installcheck
 check: check-subdir
@@ -371,10 +371,12 @@ TAGS: $(CFILES)
        etags `for i in $(CFILES); do echo $(srcdir)/$$i ; done`
 
 # The standalone demangler (c++filt) has been moved to binutils.
-demangle:
+# But make this target work anyway for demangler hacking.
+demangle: $(ALL) $(srcdir)/cp-demangle.c
        @echo "The standalone demangler, now named c++filt, is now"
        @echo "a part of binutils."
-       @false
+       $(CC) @DEFS@ $(CFLAGS) $(CPPFLAGS) -I. -I$(INCDIR) $(HDEFINES) \
+         $(srcdir)/cp-demangle.c -DSTANDALONE_DEMANGLER $(TARGETLIB) -o $@
 
 ls:
        @echo Makefile $(CFILES)
@@ -722,7 +724,7 @@ $(CONFIGURED_OFILES): stamp-picdir
 
 ./lbasename.o: $(srcdir)/lbasename.c config.h $(INCDIR)/ansidecl.h \
        $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
-       $(INCDIR)/safe-ctype.h
+       $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h
        if [ x"$(PICFLAG)" != x ]; then \
          $(COMPILE.c) $(PICFLAG) $(srcdir)/lbasename.c -o pic/$@; \
        else true; fi

There doesn't seem to be any relevant difference.

The last mention of -print-multi-os-directory in the ChangeLog is:

2003-01-27  Alexandre Oliva  <aoliva@redhat.com>

        * Makefile.in (install_to_tooldir): Instead of $(MULTISUBDIR), use
        /`$$CC -print-multi-os-directory`.

Which is much earlier than 7.0.

I'm a bit puzzled how this isn't visible with 7.0.

Note that libiberty is "owned" by gcc.
Comment 2 Tom Tromey 2018-09-26 11:51:09 UTC
Is this still an issue?
Comment 3 tim.mooney 2018-09-26 18:10:28 UTC
My bug report originated 7 years ago.  I no longer have access to Solaris 10.  I do still use one of the descendants of OpenSolaris, but even that descendant (OpenIndiana) has diverged enough from Oracle Solaris that recent versions of the Oracle Studio compiler no longer really work.

My recommendation is that you close this report.
Comment 4 Tom Tromey 2018-09-26 18:16:13 UTC
Ok, thank you.