Bug 46334 - C++ compiler gets g++ switch even if it isn't g++
Summary: C++ compiler gets g++ switch even if it isn't g++
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2010-11-06 16:45 UTC by Jay
Modified: 2021-07-19 17:07 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
toplevel config.log (6.26 KB, application/octet-stream)
2010-11-07 23:08 UTC, Jay
Details
libcpp config.log (11.12 KB, application/octet-stream)
2010-11-07 23:08 UTC, Jay
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jay 2010-11-06 16:45:18 UTC
if C compiler is gcc and C++ compiler is not g++, C++ compiler gets g++ flags
(maybe redirect to autoconf?)

export CXX=/usr/bin/CC
gcc-4.5.1/configure -enable-build-with-cxx

 
 /usr/bin/CC -c  -g -DIN_GCC   -W -Wall -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.5/gcc -I../../gcc-4.5/gcc/. -I../../gcc-4.5/gcc/../include -I../../gcc-4.5/gcc/../libcpp/include -I/home/jkrell/dev2/cm3/m3-sys/m3cc/SOLsun/./gmp -I/home/jkrell/dev2/cm3/m3-sys/m3cc/gcc-4.5/gmp  -I../../gcc-4.5/gcc/../libdecnumber -I../../gcc-4.5/gcc/../libdecnumber/dpd -I../libdecnumber   -I/usr/include/libelf  ../../gcc-4.5/gcc/df-core.c -o df-core.o
CC: Warning: Option -W passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wall passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wwrite-strings passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wmissing-format-attribute passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -pedantic passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wno-long-long passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wno-variadic-macros passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wno-overlength-strings passed to ld, if ld is invoked, ignored otherwise
/usr/bin/CC -c  -g -DIN_GCC   -W -Wall -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros


seems a bit off.

I'm trying now with CXX=CC, CC=cc.
The autoconf log is looking better.


 - Jay
Comment 1 Jay 2010-11-07 23:08:17 UTC
Created attachment 22315 [details]
toplevel config.log
Comment 2 Jay 2010-11-07 23:08:57 UTC
Created attachment 22316 [details]
libcpp config.log
Comment 3 Jay 2010-11-07 23:10:50 UTC
jkrell@login [login]:~/src > ssh current10s
Last login: Sun Nov  7 23:09:51 2010 from login.bo.opencs
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
-bash-4.1$ cd obj
-bash-4.1$ mkdir b
-bash-4.1$ cd b
-bash-4.1$ which gcc
no gcc in /home/jkrell/sparc/bin /opt/csw/bin /usr/bin /usr/ccs/bin /opt/csw/bin
-bash-4.1$ export CC=/opt/csw/gcc4/bin/gcc
-bash-4.1$ $CC -v
Using built-in specs.
Target: sparc-sun-solaris2.8
Configured with: ../gcc-4.3.3/configure --prefix=/opt/csw/gcc4 --exec-prefix=/opt/csw/gcc4 --with-gnu-as --with-as=/opt/csw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-nls --with-included-gettext --with-libiconv-prefix=/opt/csw --with-x --with-mpfr=/opt/csw --with-gmp=/opt/csw --enable-java-awt=xlib --enable-libada --enable-libssp --enable-objc-gc --enable-threads=posix --enable-stage1-languages=c --enable-languages=ada,c,c++,fortran,java,objc
Thread model: posix
gcc version 4.3.3 (GCC) 
-bash-4.1$ export CXX=CC
-bash-4.1$ $CXX -V
CC: Sun C++ 5.9 SunOS_sparc 2007/05/03
-bash-4.1$ which ar
/usr/ccs/bin/ar
-bash-4.1$ which gmake
/opt/csw/bin/gmake
-bash-4.1$ which make
/usr/ccs/bin/make
-bash-4.1$ export MAKE=gmake
-bash-4.1$ uname -a
SunOS current10s 5.10 Generic_142909-17 sun4v sparc SUNW,SPARC-Enterprise-T5220


/home/jkrell/src/gcc-trunk/configure -prefix=$HOME/test2 -enable-build-with-cxx && $MAKE

.....


gmake[3]: Entering directory `/home/jkrell/obj/b/libcpp'
source='/home/jkrell/src/gcc-trunk/libcpp/charset.c' object='charset.o' libtool=no DEPDIR=.deps depmode=dashXmstdout /bin/bash /home/jkrell/src/gcc-trunk/libcpp/../depcomp CC  -I/home/jkrell/src/gcc-trunk/libcpp -I. -I/home/jkrell/src/gcc-trunk/libcpp/../include -I./../intl -I/home/jkrell/src/gcc-trunk/libcpp/include  -g -W -Wall -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -I/home/jkrell/src/gcc-trunk/libcpp -I. -I/home/jkrell/src/gcc-trunk/libcpp/../include -I./../intl -I/home/jkrell/src/gcc-trunk/libcpp/include  -c /home/jkrell/src/gcc-trunk/libcpp/charset.c
CC: Warning: Option -W passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wall passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wwrite-strings passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wmissing-format-attribute passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -pedantic passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wno-long-long passed to ld, if ld is invoked, ignored otherwise


attached toplevel config.log and libcpp/config.log
excerpt:

configure:4440: checking whether /opt/csw/gcc4/bin/gcc supports -pedantic -Wno-long-long
WARN_PEDANTIC='-pedantic -Wno-long-long'


so you can see, CC and CXX are configured the same by autoconf, even though they
might not be related.
Comment 4 Jay 2010-11-08 01:10:25 UTC
another, this is an older Darwin/powerpc machine, using some version of g++


http://hudson.modula3.com:8080/job/cm3-current-m3cc-PPC_DARWIN/93/consoleFull


g++  -g  -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute    -DHAVE_CONFIG_H  -o m3cgc1 m3cg/parse.o m3cg/m3-convert.o attribs.o main.o  libbackend.a ../libcpp/libcpp.a ../libcpp/libcpp.a ../libiberty/libiberty.a  -L/Volumes/luthien/home/hudson2/workspace/cm3-m3cc-PPC_DARWIN/cm3/m3-sys/m3cc/PPC_DARWIN/./gmp/.libs -lgmp   -L/Volumes/luthien/home/hudson2/workspace/cm3-m3cc-PPC_DARWIN/cm3/m3-sys/m3cc/PPC_DARWIN/./gmp/.libs -lgmp   


ld: Undefined symbols:
__Z29legitimate_indirect_address_pP7rtx_defi


Presumed fix: remove inline on config/rs6000/rs6000.c/legitimate_indirect_address.