yetist / ios-toolchain-based-on-clang-for-linux

Automatically exported from code.google.com/p/ios-toolchain-based-on-clang-for-linux
0 stars 0 forks source link

use of undeclared identifier 'OFILE_LLVM_BITCODE' #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install clang 3.2-1 from Ubuntu 13.04 or clang 3.4-1 on Debian from LLVM APT.
2. ./configure --target=arm-apple-darwin11 --prefix=/usr && make
3. Get error 

What is the expected output? What do you see instead?
libtool.c:1369:38: error: use of undeclared identifier 'OFILE_LLVM_BITCODE'
                            ofiles[i].arch_type == OFILE_LLVM_BITCODE){
                                                   ^
1 error generated.

What version of the product are you using? On what operating system?
Ubuntu 13.04/Debian 7.0

Please provide any additional information below.

I found definition of OFILE_LLVM_BITCODE in file /include/stuff/ofile.h

enum ofile_type {
    OFILE_UNKNOWN,
    OFILE_FAT,
    OFILE_ARCHIVE,
    OFILE_Mach_O
#ifdef LTO_SUPPORT
    ,
    OFILE_LLVM_BITCODE
#endif /* LTO_SUPPORT */
};

When I remove the LTO_SUPPORT condition and make again I get

lto_file.cpp:47:10: fatal error: 'llvm-c/lto.h' file not found
#include "llvm-c/lto.h"
         ^
1 error generated.

after adding #define LTO_SUPPORT to the beggining of ofile.h I get :

../libstuff/.libs/libstuff.a(libstuff_la-ofile.o): In function 
`ofile_specific_member':
/cctools-836/libstuff/ofile.c:2348: undefined reference to `is_llvm_bitcode'
 ../libstuff/.libs/libstuff.a(libstuff_la-ofile.o): In function `ofile_first_member':
/cctools-836/libstuff/ofile.c:1885: undefined reference to `is_llvm_bitcode'
../libstuff/.libs/libstuff.a(libstuff_la-ofile.o): In function 
`ofile_next_member':
/cctools-836/libstuff/ofile.c:2110: undefined reference to `is_llvm_bitcode'
../libstuff/.libs/libstuff.a(libstuff_la-ofile.o): In function 
`ofile_map_from_memory':
/cctools-836/libstuff/ofile.c:1336: undefined reference to `is_llvm_bitcode'
 ../libstuff/.libs/libstuff.a(libstuff_la-ofile.o): In function `ofile_specific_arch':
/cctools-836/libstuff/ofile.c:1620: undefined reference to `is_llvm_bitcode'
../libstuff/.libs/libstuff.a(libstuff_la-ofile.o):/home/daniel/Dokumenty/toolchi
an/cctools-836/libstuff/ofile.c:2918: more undefined references to 
`is_llvm_bitcode' follow
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any ideas ? I've tryed building under both - Ubuntu and Debian both 64bit in 
newest versions with all updates installed (Clang versions mentioned above).

Original issue reported on code.google.com by daniel.z...@gmail.com on 25 Aug 2013 at 11:10

GoogleCodeExporter commented 9 years ago
Even tried on Fedora 19 with Clang 3.4 both 64 bit, still the some.

Original comment by daniel.z...@gmail.com on 27 Aug 2013 at 12:34

GoogleCodeExporter commented 9 years ago
Same problem in same platform Ubuntu 13.04.

Original comment by faustoca...@gmail.com on 2 Sep 2013 at 5:54

GoogleCodeExporter commented 9 years ago
You all need the LLVM development packages installed.

    ubuntu$ sudo apt-get install llvm-dev

    fedora$ sudo yum install llvm-devel

It should probably be mentioned on the how-to page, though.

Original comment by scott...@gmail.com on 5 Sep 2013 at 6:36

GoogleCodeExporter commented 9 years ago
Yes, just as scottywz said, you need install llvm development package which 
containes lto.h.

LTO is a common feature that llvm provides, It should always be there.

It seems I should change configure script to detect the header and give a hint.

Original comment by cjac...@gmail.com on 23 Sep 2013 at 6:45

GoogleCodeExporter commented 9 years ago
commited to svn.

Original comment by cjac...@gmail.com on 23 Sep 2013 at 7:02

GoogleCodeExporter commented 9 years ago
the cctools 1.3 and iphonesdk-utils 2.0 in download sections had been tested 
with ubuntu 13.04 with clang/llvm-3.2. 

Since the clang/llvm-3.2 package shipped with ubuntu use a customized path to 
hold headers and libraries, please refer to "Howto" in wiki sections to setup 
proper Header path for ubuntu.

Original comment by cjac...@gmail.com on 23 Sep 2013 at 12:26