Bug 140333 - Problem cross-compiling C and Fortran
Summary: Problem cross-compiling C and Fortran
Status: RESOLVED INVALID
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Development (show other bugs)
Version: unspecified
Hardware: i586 SuSE Linux 10.0
: P5 - None : Major
Target Milestone: ---
Assignee: Philipp Thomas
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-20 14:13 UTC by George Jenkins
Modified: 2006-01-02 08:10 UTC (History)
0 users

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Jenkins 2005-12-20 14:13:39 UTC
I am having problems compiling a program that has mixed C and Fortran
code. The individual files compile OK with the respective compilers gcc
and gfortran. I am having problems linking them together.

I have the LD_LIBRARY_PATH set to /usr/lib. 

If you link the objects with gcc, you get the error:

/usr/lib/gcc/i586-suse-linux/4.0.2/../../../crt1.o: In function
`_start':
../sysdeps/i386/elf/start.S:115: undefined reference to `main'
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld:
BFD 2.16.91.0.2 20050720 (SuSE Linux) internal error, aborting at
../../bfd/dwarf2.c line 1787 in scan_unit_for_symbols

/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld:
Please report this bug.

collect2: ld returned 1 exit status
make: *** [sigpro] Error 1
------------------------------------------------------------
If you link the objects with gfortran, you get the error:

ld: BFD 2.16.91.0.2 20050720 (SuSE Linux) internal error, aborting at
../../bfd/dwarf2.c line 1787 in scan_unit_for_symbols

ld: Please report this bug.

make: *** [sigpro] Error 1

The command I am using to make them is:
gcc -g -o sigpro -L/apps/qtsi/seatools/lib -I../../include
-I/apps/qtsi/cm/dev/from_usndc/include/array_structs
-I/apps/qtsi/cm/dev/from_usndc/include buildarg.o [...lots of other
objects and libraries...]

We are running Suse 10.0 on Panasonic Toughbooks CF-29s.

gcc -v yields:
qtsi@linux:~/mix> gcc -v
Using built-in specs.
Target: i586-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,f95,java,ada --disable-checking
--with-gxx-include-dir=/usr/include/c++/4.0.2 --enable-java-awt=gtk
--disable-libjava-multilib --with-slibdir=/lib --with-system-zlib
--enable-shared --enable-__cxa_atexit --without-system-libunwind
--host=i586-suse-linux
Thread model: posix
gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)

gfortran -v yields:
qtsi@linux:~/mix> gfortran -v
Using built-in specs.
Target: i486-pld-linux
Configured with: ../configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-languages=c,c++,f95,objc,obj-c++,ada --enable-c99
--enable-long-long --disable-multilib --enable-nls --disable-werror
--with-gnu-as --with-gnu-ld --with-demangler-in-ld --with-system-zlib
--with-slibdir=/lib --without-x --enable-cmath i486-pld-linux
Thread model: posix
gcc version 4.1.0 20051113 (experimental)

I am sorry that I cannot post a test case. I made a small program that incorporates C and Fortran, but it compiled OK> If I could find out what is causing BFD to burp, I might be able to narrow down the problem for you. Please let me know if there is anything more that I can send to you to help you find this problem.

- George Jenkins
gjenkins@qtsi.com
Comment 1 Philipp Thomas 2005-12-20 15:27:47 UTC
Without a test case I'm afraid we can't do much.
Comment 2 Philipp Thomas 2006-01-02 08:10:55 UTC
Closing by request of originator.