Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2004
    Location
    Istanbul
    Posts
    17

    Question Unanswered: Need help on 64 bit compilation issue

    The following is a short description of my problem.
    The Execution line that starts with "CC -c ..." is a sample of the compile command that has been prepared by my Makefile. (colored as darkgreen)
    The option xtarget=ultra -xarch=v9 enables the compiler to build 64 bit .o files.
    But when the CC comes to sequence of linking ( which is the line that starts with "CC -G ..." ) the linker is encountering a problem... (colored as purple)
    (wrong ELF class: ELFCLASS64) HOW CAN THIS BE ? And How can I solve this problem.

    NOTE: I've cleaned all the 32 bit .o files before recompiling and linking the project.
    If possible can anyone tell me what parameter inside the Makefile sends the linker ( which is I presume that "ld" ) correct option to link the files into a single .so file ?

    __ My OS information __________________________________________________
    myhostname% uname -a
    SunOS myhostname 5.8 Generic_117000-01 sun4u sparc SUNW,Ultra-5_10
    myhostname%
    __________________________________________________ _______________

    __________________________
    myhostname% make
    Making ./common/port/ ...
    .
    . here some other fıles exists
    .
    CC -c -DOSTYPE_UNIX -DOSNAME_SunOS -DOSVERSION_5_8 -D_RWCONFIG_0d -DRW_FIX_XSIZE_T -library=iostream,no%Cstd -D__INF_SUPPORTS_BOOL -DRW_NO_STL -cg92 -dalign -O2 -pic -DSOLARIS -DX11R6 -DNeedFunctionPrototypes -DNeedVarargsPrototypes -DDBG_ON -DINFDEBUG -DRC_USE_CSTYLE_CAST +p -mt +w -DBUILD_FINPORT -xtarget=ultra -xarch=v9 infwait.cxx
    .
    . here some other files exists
    .
    CC -G -o /export/home/infinity3/src/libdbg/libFinPort.so -L/export/home/infinity3/src/libdbg -lsocket -lnsl -ldl -lc
    00CritSection.o 00Mutex.o 00CopyHostent.o
    00CopyServent.o 00SynchObj.o dynamicLoader.o infallocconsole.o
    infassert.o infatomic.o infcrypt.o infctime.o infdeletefile.o
    infexecvp.o inffile.o inffileattr.o infgeterror.o infgethostbyaddr.o
    infgethostbyname.o infgethostipaddress.o infgethostname.o infgetopt.o
    infgetservbyname.o infgetsockname.o infgettimeofday.o infgettmpdir.o
    infgetusername.o infmemory.o infrand48.o infrlimit.o infselect.o
    infsleep.o infSocketInit.o infstrerror.o infthreadbase.o inftimeval.o
    inftrace.o infuname.o infwait.o returnString.o ;

    ld: fatal: file 00CritSection.o: wrong ELF class: ELFCLASS64
    ld: fatal: File processing errors. No output written to /export/home/infinity3/s
    rc/libdbg/libFinPort.so
    *** Error code 1
    make: Fatal error: Command failed for target `/export/home/infinity3/src/libdbg/
    libFinPort.so'
    Current working directory /export/home/infinity3/src/common/port
    *** Error code 1
    make: Fatal error: Command failed for target `allfinbase'

    myhostname%_
    __________________________________________________ _____________________________________________
    The above thing that i am trying to compile uses RogueWave headers. But I'm already using this headers while compiling the project. I think that my real problem is setting the flags of CC command correctly. Because ld can not combine the items to form a so file...
    Whenever I can get this so file i can use the functions classes etc. with in the PLSQL code. ofcourse by defining external functions. All my settings are ready but I lack the .so file...

    Thank you for attention.
    Last edited by Andurin; 08-12-04 at 10:18.

  2. #2
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    Hi,

    I think the cause of your problem is that you try to compile in 64-bit, but there is a conflict between 32-bit and 64-bit... Maybe one of your dynamic libraries has been compiled in 32-bit... You may try not to use the -G option (I'm not sure of what this does). I personally compile in 64-bit with -xarch=v9 under Solaris 9 and have no problem, but I did have problems when trying to link to 32-bit libraries.

  3. #3
    Join Date
    Aug 2004
    Location
    Istanbul
    Posts
    17
    Quote Originally Posted by RBARAER
    Hi,

    I think the cause of your problem is that you try to compile in 64-bit, but there is a conflict between 32-bit and 64-bit... Maybe one of your dynamic libraries has been compiled in 32-bit... You may try not to use the -G option (I'm not sure of what this does). I personally compile in 64-bit with -xarch=v9 under Solaris 9 and have no problem, but I did have problems when trying to link to 32-bit libraries.
    But I am using -xarch=v9 option already. And I am sure that none of the .o files are compiled as 32-bit. I can combine the .o files with the command:
    ld -r -o anyname.so *.o this makes the linker to build an so file with the o files inside the current directory. But this is also not a solution to my problem. The makefile should build this entire project. Some how I need to eleminate this ELFCLASS64 error.
    Please help.

    Thank you for your attention.

  4. #4
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    I understand, but as far as I know, Wrong ELFCLASS means there is a conflict between 32 and 64-bit. I think that one of the dynamic libraries (a .so file) you try to link your app with (-lsocket -lnsl -ldl -lc) has not been originally compiled in 64-bit. You can try to check that if you have not already. If the problem does not originate from here, then I fear I will not be able to help you more than I did. Sorry.

    RBARAER

  5. #5
    Join Date
    Aug 2004
    Location
    Istanbul
    Posts
    17

    Wink Thanks a LOT for the help... but...

    Quote Originally Posted by RBARAER
    I understand, but as far as I know, Wrong ELFCLASS means there is a conflict between 32 and 64-bit. I think that one of the dynamic libraries (a .so file) you try to link your app with (-lsocket -lnsl -ldl -lc) has not been originally compiled in 64-bit. You can try to check that if you have not already. If the problem does not originate from here, then I fear I will not be able to help you more than I did. Sorry.

    RBARAER
    Most probably you're correct. Linker is using the 32 bit dynamic libraries while trying to link mine ones. So it is trying to combine 32-bit ones and 64-bit ones here. Now I understood the exact problem.
    But this observation brings another problem. I have to compile the entire system libraries as 64 bit. There must be a problem with my OS installation sequence. These libraries should be 64-bit as far as i know.

    Thanks for the help RBARAER...
    Any other help is acceptible ofcourse. I still have problems

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •