Comment #10 on issue 897 by [email protected]: Can't select
/opt/csw/gcc4/bin/g{cc,++} as the compiler in the presence of /usr/bin/cc
http://code.google.com/p/v8/issues/detail?id=897
Re: the platform error, I think that it's related to the Sun Studio
compiler defining different flags for the x86 and amd64 platforms, so the
architecture detection in globals.h doesn't work. It might work on gcc
without issues.
Back to the linker problem, I've first verified that using
/opt/csw/gcc4/bin/gcc will work:
mac...@testing10x [testing10x]:~/src/v8/build-solaris >
/opt/csw/gcc4/bin/gcc -o obj/release/so_accessors.o -c -Wall -Werror -W
-Wno-unused-parameter -Wnon-virtual-dtor -m32 -O3 -fomit-frame-pointer
-fdata-sections -ffunction-sections -ansi -fno-rtti -fno-exceptions -KPIC
-Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -m32 -O3
-fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -KPIC
-DV8_TARGET_ARCH_IA32 -D__C99FEATURES__ -DENABLE_VMSTATE_TRACKING
-DENABLE_LOGGING_AND_PROFILING -DENABLE_DEBUGGER_SUPPORT -I/opt/csw/include
-I/usr/local/include -I/home/maciej/src/v8/src
/home/maciej/src/v8/src/accessors.cc
gcc: unrecognized option '-KPIC'
gcc: unrecognized option '-KPIC'
mac...@testing10x [testing10x]:~/src/v8/build-solaris > echo $?
0
It works, so I can try adding the LINK= option:
mac...@testing10x [testing10x]:~/src/v8/build-solaris >
CC=/opt/csw/gcc4/bin/gcc CXX=/opt/csw/gcc4/bin/g++
RANLIB=/opt/csw/gcc4/bin/ranlib LD=/opt/csw/bin/gld AR=/opt/csw/bin/gar
LINK=/opt/csw/gcc4/bin/gcc scons -Y .. visibility=default library=shared
toolchain=gcc
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/opt/studio/SOS11/SUNWspro/bin/CC -o obj/release/so_accessors.o -c -Wall
-Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -m32 -O3
-fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -fno-rtti
-fno-exceptions -KPIC -Wall -Werror -W -Wno-unused-parameter
-Wnon-virtual-dtor -m32 -O3 -fomit-frame-pointer -fdata-sections
-ffunction-sections -ansi -KPIC -DV8_TARGET_ARCH_IA32 -D__C99FEATURES__
-DENABLE_VMSTATE_TRACKING -DENABLE_LOGGING_AND_PROFILING
-DENABLE_DEBUGGER_SUPPORT -I/opt/csw/include -I/usr/local/include
-I/home/maciej/src/v8/src /home/maciej/src/v8/src/accessors.cc
CC: Warning: Option -Wall passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Werror passed to ld, if ld is invoked, ignored
otherwise
CC: Warning: Option -W passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wno-unused-parameter passed to ld, if ld is invoked,
ignored otherwise
CC: Warning: Option -Wnon-virtual-dtor passed to ld, if ld is invoked,
ignored otherwise
CC: Warning: Option -m32 passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -fomit-frame-pointer passed to ld, if ld is invoked,
ignored otherwise
CC: Warning: Option -fdata-sections passed to ld, if ld is invoked, ignored
otherwise
CC: Warning: Option -ffunction-sections passed to ld, if ld is invoked,
ignored otherwise
CC: Warning: Option -ansi passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -fno-rtti passed to ld, if ld is invoked, ignored
otherwise
CC: Warning: Option -fno-exceptions 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 -Werror passed to ld, if ld is invoked, ignored
otherwise
CC: Warning: Option -W passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -Wno-unused-parameter passed to ld, if ld is invoked,
ignored otherwise
CC: Warning: Option -Wnon-virtual-dtor passed to ld, if ld is invoked,
ignored otherwise
CC: Warning: Option -m32 passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -fomit-frame-pointer passed to ld, if ld is invoked,
ignored otherwise
CC: Warning: Option -fdata-sections passed to ld, if ld is invoked, ignored
otherwise
CC: Warning: Option -ffunction-sections passed to ld, if ld is invoked,
ignored otherwise
CC: Warning: Option -ansi passed to ld, if ld is invoked, ignored otherwise
"/home/maciej/src/v8/src/globals.h", line 59: Error: #error Host
architecture was not detected as supported by v8.
scons: *** [obj/release/so_accessors.o] Error 1
scons: building terminated because of errors.
mac...@testing10x [testing10x]:~/src/v8/build-solaris >
It still tries to use Sun Studio.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev