This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: configure problem on solaris 9


> Ivan Gomez Martin <igomez@qindel.es> wrote:
>Sent: Apr 23, 2008 7:46 AM
>To: gcc-help@gcc.gnu.org
>Subject: Re: configure problem on solaris 9
>
>g6522c@earthlink.net escribiÃ:
>>> IvÃn GÃmez <igomez@qindel.com> wrote:
>>>
>>> I'm trying to compile the clamav pakage on solaris 9 with the gcc  
>>> enviroment installed form sunfreeware:
>>>
>>> autoconf (GNU Autoconf) 2.57
>>>
>>> Reading specs from /usr/local/lib/gcc/i386-pc-solaris2.9/3.4.6/specs
>>> Configured with: ../configure --with-as=/usr/ccs/bin/as  
>>> --with-ld=/usr/ccs/bin/ld --enable-shared
>>> --enable-languages=c,c++,f77
>>> Thread model: posix
>>> gcc version 3.4.6
>>>
>>> I'm trying to compile it like:
>>> ./configure CC=gcc CFLAGS="-O2  -Wl,-R,/usr/local/lib  
>>> -Wl,-R,/opt/QNDgmp/lib -L/opt/QNDgmp/lib
>>> -L/usr/local/lib"   CPPFLAGS="-O2"  --with-ld=/usr/local/bin/ld  
>>> CPPFLAGS="-I/opt/QNDgmp/include"
>>>
>>> but it comes to the following error:
>>>
>>> checking for cc option to accept ISO C89... unsupported
>>> checking dependency style of cc... gcc3
>>> checking for a sed that does not truncate output... /usr/bin/sed
>>> checking for grep that handles long lines and -e... /usr/xpg4/bin/grep
>>> checking for egrep... /usr/xpg4/bin/grep -E
>>> checking for ld used by cc... /usr/ccs/bin/ld
>>> checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
>>> checking for /usr/ccs/bin/ld option to reload object files... -r
>>> checking for BSD-compatible nm... /usr/local/bin/nm -B
>>> checking how to recognize dependent libraries... pass_all
>>> checking how to run the C preprocessor... /lib/cpp
>>> configure: error: C preprocessor "/lib/cpp" fails sanity check
>>> See `config.log' for more details.
>>>
>>>
>>>
>>> where config.log:
>>> configure:3896: checking for cc option to accept ISO C89
>>> configure:3970: cc  -c -g  -Wl,-R,/usr/local/lib -Wl,-R,/usr/lib  
>>> -Wl,-R,/usr/ccs/lib
>>> -Wl,-R,/usr/share/lib -Wl,-R,/opt/QNDgmp/lib -L/opt/QNDgmp/lib -L/
>>> usr/local/lib -L/usr/lib -L/usr/ccs/lib -L/usr/share/lib -I/opt/QNDgmp/include
>>> -I/usr/local/lib/gcc/i386-pc-solaris2.9/3.4.6/include/ conftest.c >&5
>>> In file included from conftest.c:11:
>>> /usr/local/lib/gcc/i386-pc-solaris2.9/3.4.6/include/stdio.h:36:27:  
>>> iso/stdio_iso.h: No such file or
>>> directory
>>> In file included from conftest.c:11:
>>> /usr/local/lib/gcc/i386-pc-solaris2.9/3.4.6/include/stdio.h:107:  
>>> error: `__longlong_t' does not name
>>> a type
>>> ........
>>> usr/local/lib/gcc/i386-pc-solaris2.9/3.4.6/include/sys/types.h:573:24:  
>>> sys/select.h: No such file or
>>> directory
>>> conftest.c:13:22: sys/stat.h: No such file or directory
>>> conftest.c:16: error: expected constructor, destructor, or type  
>>> conversion before '*' token
>>> conftest.c:17: error: `p' was not declared in this scope
>>> conftest.c:17: error: `i' was not declared in this scope
>>> conftest.c:18: error: initializer expression list treated as compound  
>>> expression
>>> conftest.c:18: error: expected `,' or `;' before "char"
>>> conftest.c:20: error: expected unqualified-id before '{' token
>>> conftest.c:50: error: `FILE' has not been declared
>>> conftest.c:50: error: ISO C++ forbids declaration of `parameter' with no type
>>> conftest.c: In function `int main()':
>>> conftest.c:56: error: cannot convert `char*' to `char*(*)(char**,  
>>> int)' for argument `1' to `char*
>>> f(char*(*)(char**, int), char**, ...)'
>>> conftest.c:56: error: cannot convert `char*' to `char*(*)(char**,  
>>> int)' for argument `1' to `char*
>>> f(char*(*)(char**, int), char**, ...)'
>>> configure:3976: $? = 1
>>> configure: failed program was:
>>> | /* confdefs.h.  */
>>> | #define PACKAGE_NAME "clamav"
>>> | #define PACKAGE_T
>>> ........
>>> configure:3970: cc -qlanglvl=extc89 -c -g  -Wl,-R,/usr/local/lib  
>>> -Wl,-R,/usr/lib -Wl,-R,/usr/ccs/lib
>>> -Wl,-R,/usr/share/lib -Wl,-R,/opt/QNDgmp/lib -L/op
>>> t/QNDgmp/lib -L/usr/local/lib -L/usr/lib -L/usr/ccs/lib  
>>> -L/usr/share/lib -I/opt/QNDgmp/include
>>> -I/usr/local/lib/gcc/i386-pc-solaris2.9/3.4.6/include/ c
>>> onftest.c >&5
>>> cc: unrecognized option `-qlanglvl=extc89'
>>> ..........
>>> configure:3970: cc -qlanglvl=ansi -c -g  -Wl,-R,/usr/local/lib  
>>> -Wl,-R,/usr/lib -Wl,-R,/usr/ccs/lib
>>> -Wl,-R,/usr/share/lib -Wl,-R,/opt/QNDgmp/lib -L/opt/
>>> QNDgmp/lib -L/usr/local/lib -L/usr/lib -L/usr/ccs/lib -L/usr/share/lib  
>>> -I/opt/QNDgmp/include
>>> -I/usr/local/lib/gcc/i386-pc-solaris2.9/3.4.6/include/ con
>>> ftest.c >&5
>>> cc: unrecognized option `-qlanglvl=ansi'
>>> .............
>>> configure:5107: /lib/cpp -I/opt/QNDgmp/include
>>> -I/usr/local/lib/gcc/i386-pc-solaris2.9/3.4.6/include/ conftest.c
>>> "conftest.c", line 13: Can't find include file assert.h
>> 
>> The contents of the SHELL and PATH environment variables should help
>> to determine whether that configure script is finding a SunOS program 
>> in /usr/bin or /usr/ccs/bin, or one of the older GNU compilers from 
>> the Solaris supplemental software disk, which changed their location 
>> from /opt/sfw to /usr/sfw - (sometime between Solaris 8 and Solaris 
>> 10, I skipped a version, so I'm not certain exactly when), and the
>> sunfreeware.org package, which is in /usr/local.  
>> 
>> The PATH must be set correctly for the *login* shell.  You might 
>> need to set it in /etc/profile, /etc/cshrc.  The GNU configure
>> script should not depend on a particular version of the compiler
>> as well as cpp, and as, but, of course, the configure script has
>> to find the same tools during the build process.  It is actually
>> flexible enough that you can switch tool chains rather quickly.
>> 
>> YMMV - this solves 90 percent of the issues I have with compiler 
>> version skew.
>> 
>> 
>> 
>> 
>> 
>> 
>> ----------------------------------------------------------------------------
>> Ctalk Project Home Page: http://ctalk-lang.sourceforge.net
>> Mailing List:  ctalk-lang-announce@lists.sourceforge.net
>> ----------------------------------------------------------------------------
>
>Thanks for your help. I solved it. It was only some missing headers. But now I have a problem 
>linking which I don't know how to face. I've been searching and some people says that they had the 
>same problem and solved it with the gnu ld. But I'm already using it.
>
>bash# which ld
>/usr/local/bin//ld
>bash# ld -V
>GNU ld version 2.17
>   Supported emulations:
>    elf_i386_ldso
>    elf_i386
>    elf_x86_64
>
>echo $PATH
>/usr/local/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
>
>echo $LD_LIBRARY_PATH
>
>and the error is
>
>ld: fatal: relocations remain against allocatable but non-writable sections
>collect2: ld returned 1 exit status

I could only suggest  -Wl,-R /usr/local/lib as the first
library path.  Then the "file" command should be able to determine 
if the libraries in /usr/ccs/lib and /opt/QNDgmp/lib have the same 
format as the GNU  libraries.  Ld should then be able to resolve 
the GCC symbols correctly as long as the libraries are compatible
*and* it can resolve any dependencies that are in the additional
libraries.  Unfortunately, I can't duplicate the configuration
here, so, once again, YMMV.

Regards, 

Robert Kiesling







---------------------------------------------------
Ctalk Home Page: http://www.ctalklang.org/.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]