the g++ from the SFE repository.
root@solewer:/usr/gcc/4.6# g++ --version
g++ (GCC) 4.6.2
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
But this results in a lot of errors during the assembly stage:
root@solewer:~# g++ a.cpp
Assembler: a.cpp
"/var/tmp//cclAa4ot.s", line 80 : Syntax error
Near line: " .uleb128 .LLSDACSE549-.LLSDACSB549"
"/var/tmp//cclAa4ot.s", line 82 : Syntax error
Near line: " .uleb128 .LEHB0-.LFB549"
"/var/tmp//cclAa4ot.s", line 83 : Syntax error
Near line: " .uleb128 .LEHE0-.LEHB0"
With the g++ from /usr/sfw/bin ( pkg://openindiana.org/
) the compilation succeeded.
I've now started with execsnoop to see whats happening:
g++ from the SFE repository uses the default assembler:
UID PID PPID ARGS
0 7755 7662 g++ a.cpp
0 7756 7755
/usr/gcc/4.6/lib/gcc/i386-pc-
solaris2.11/4.6.2/cc1plus -quiet a.cpp
-quiet -dum
0 7758 7662 /usr/bin/hostname
0 7757 7755 /usr/ccs/bin/as -s -o /var/tmp//ccYHayjp.o
/var/tmp//ccXHayjp.s
but using /usr/sfw/bin/g++ from (
pkg://openindiana.org/
0 7762 7662 /usr/sfw/bin/g++ a.cpp
0 7763 7762
/usr/sfw/libexec/gcc/i386-pc-solaris2.11/3.4.3/cc1plus -quiet a.cpp
-quiet -dum
0 7764 7762 /usr/sfw/libexec/gcc/i386-pc-solaris2.11/3.4.3/as
--traditional-format -Qy -s -
0 7765 7762
/usr/sfw/libexec/gcc/i386-pc-solaris2.11/3.4.3/collect2 -Y
P,/usr/ccs/lib:/lib:
Compiling a C file with gcc works for both 4.6.2 and 3.4.3
The usage of the assembler under ccs is the problem. I searched for
other assemblers on my system and found:
root@solewer:/usr# find . -name as -print
./gnu/i386-pc-solaris2.11/bin/
as
./bin/as
./sfw/libexec/gcc/i386-pc-solaris2.11/3.4.3/as
./ccs/bin/as
./share/locale/as
But the searchpath of gcc does not search in /usr/gnu:
[ewer@solewer:~/tmp]$g++ -print-search-dirs
...
programs: =/usr/gcc/4.6/lib/gcc/i386-pc-solaris2.11/4.6.2/:/usr/gcc/4. 6/lib/gcc/i386-pc-solaris2.11/ 4.6.2/:/usr/gcc/4.6/lib/gcc/ i386-pc-solaris2.11/:/usr/gcc/ 4.6/lib/gcc/i386-pc-solaris2. 11/4.6.2/:/usr/gcc/4.6/lib/ gcc/i386-pc-solaris2.11/:/usr/ gcc/4.6/lib/gcc/i386-pc- solaris2.11/4.6.2/../../../../ i386-pc-solaris2.11/bin/i386- pc-solaris2.11/4.6.2/:/usr/ gcc/4.6/lib/gcc/i386-pc- solaris2.11/4.6.2/../../../../ i386-pc-solaris2.11/bin/:/usr/ ccs/bin/i386-pc-solaris2.11/4. 6.2/:/usr/ccs/bin/
...
Programs are only search in the /usr/gcc/4.6 folders. So I made a soft
link from
/usr/gcc/4.6/i386-pc-solaris2.11 -> /usr/gnu/i386-pc-solaris2.11/
After this link the compilation and linking works again without
problems and the
created executeables can run.
But I don't know why or if this has changed. Because I had already compiled
with this compiler from the SFE repository.

No comments:
Post a Comment