[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#594138: [sparc] g++ generates 32-bit binaries while gcc generates 64-bit ones



Package: g++-4.4
Version: 4.4.4-9
Severity: normal

As specified in the subject line, on an UltraSPARC (sparc64), g++
generates 32-bit binaries by default while gcc generates 64-bit binaries
by default.  This is not only bizarre, but it makes the traditional
instructions to link combinations of C and C++ with g++ difficult.

My objection is not to generating one or the other (although it would be
nice to generate sparc64 binaries automatically if the machine is
sparc64) but that gcc and g++ behave differently.  foo.c is basically
the source to /bin/true.

  blackhole ok % make        
  ls -l
  total 16
  lrwxrwxrwx 1 bmc bmc   5 Aug 23 21:58 bar.cc -> foo.c
  -rw-r--r-- 1 bmc bmc  30 Aug 23 21:58 foo.c
  -rw-r--r-- 1 bmc bmc 191 Aug 23 22:24 Makefile
  uname -a
  Linux blackhole 2.6.32-5-sparc64 #1 Sat Jul 24 04:11:04 UTC 2010 sparc64 GNU/Linux
  dpkg -l gcc-multilib g++-multilib
  Desired=Unknown/Install/Remove/Purge/Hold
  | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
  |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
  ||/ Name                          Version                       Description
  +++-=============================-=============================-==========================================================================
  ii  g++-multilib                  4:4.4.4-2                     The GNU C++ compiler (multilib files)
  ii  gcc-multilib                  4:4.4.4-2                     The GNU C compiler (multilib files)
  cc     foo.c   -o foo
  g++     bar.cc   -o bar
  cc    -c -o foo.o foo.c
  g++ -o baz foo.o
  /usr/bin/ld: sparc:v9 architecture of input file `foo.o' is incompatible with sparc:v8plus output
  collect2: ld returned 1 exit status
  make: [baz] Error 1 (ignored)
  file foo bar baz
  foo: ELF 64-bit MSB executable, SPARC V9, relaxed memory ordering, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
  bar: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
  baz: ERROR: cannot open `baz' (No such file or directory)
  make: *** [file] Error 1

The system information has been elided because this was filed from a
different box.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachment: signature.asc
Description: Digital signature


Reply to: