Error trying to build llvm-gcc

Hi,

I was trying to build llvm-gcc by following the instructions as given in this webpage : http://llvm.org/docs/GCCFEBuildInstrs.html
on Ubuntu 7.10. At step 5 (make ENABLE_OPTIMIZED=0), I am getting make errors:

make[2]: Leaving directory /home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava' /home/pprabhu/llvm/llvm-objects/gcc/gcj -B/home/pprabhu/llvm/llvm-objects/gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include --encoding=UTF-8 -Wno-deprecated -C -g -classpath '' -bootclasspath /home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava':'../../../llvm-gcc/libjava':'../../../llvm-gcc/libjava/external/w3c_dom':'../../../llvm-gcc/libjava/external/sax -d /home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava ../../../llvm-gcc/libjava/java/lang/Class.java ../../../llvm-gcc/libjava/java/util/jar/JarFile.java:44: error: Class or interface 'gnu.java.security.pkcs.SignerInfo' not found in import. import gnu.java.security.pkcs.SignerInfo; ^ ../../../llvm-gcc/libjava/java/util/jar/JarFile.java:520: error: Type 'PKCS7SignedData' not found in the declaration of the local variable 'sig'. PKCS7SignedData sig = null; ^ ../../../llvm-gcc/libjava/java/util/jar/JarFile.java:563: error: Type 'PKCS7SignedData' not found in the declaration of the local variable 'sig'. PKCS7SignedData sig = (PKCS7SignedData) pkcs7Dsa.get(alias); ^ ../../../llvm-gcc/libjava/java/util/jar/JarFile.java:627: error: Type 'SignerInfo' not found in the declaration of the argument 'signerInfo' of method 'verify'. private void verify(Certificate[] certs, SignerInfo signerInfo, ^ 4 errors make[1]: *** [java/lang/Class.class] Error 1 make[1]: Leaving directory /home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava’
make: *** [all-target-libjava] Error 2

The java file gnu.java.security.pkcs.SignerInfo.java is not present in /home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava (or any other directory in the bootclasspath). I have libjava8-jar installed in /usr/share/java. Could this problem be due to libjava8-jar on the classpath ? (If so) How do I add /usr/share/java to the classpath and pass it to the configure script ? Or is there something else that I am missing ?

I am sorry if this question has been asked before, I searched the archives a bit, but I could not find anything related to this.

thanks,
Prakash

Prakash Prabhu wrote:

Hi,

I was trying to build llvm-gcc by following the instructions as given
in this webpage : http://llvm.org/docs/GCCFEBuildInstrs.html
on Ubuntu 7.10. At step 5 (make ENABLE_OPTIMIZED=0), I am getting make
errors:

make[2]: Leaving directory
`/home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava'
/home/pprabhu/llvm/llvm-objects/gcc/gcj
-B/home/pprabhu/llvm/llvm-objects/gcc/
-B/usr/local/i686-pc-linux-gnu/bin/
-B/usr/local/i686-pc-linux-gnu/lib/ -isystem
/usr/local/i686-pc-linux-gnu/include -isystem
/usr/local/i686-pc-linux-gnu/sys-include --encoding=UTF-8
-Wno-deprecated -C -g -classpath '' -bootclasspath
/home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava':'../../../llvm-gcc/libjava':'../../../llvm-gcc/libjava/external/w3c_dom':'../../../llvm-gcc/libjava/external/sax
-d /home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava
../../../llvm-gcc/libjava/java/lang/Class.java
../../../llvm-gcc/libjava/java/util/jar/JarFile.java:44: error: Class
or interface 'gnu.java.security.pkcs.SignerInfo' not found in import.
   import gnu.java.security.pkcs.SignerInfo;
          ^
../../../llvm-gcc/libjava/java/util/jar/JarFile.java:520: error: Type
'PKCS7SignedData' not found in the declaration of the local variable
'sig'.
                   PKCS7SignedData sig = null;
                   ^
../../../llvm-gcc/libjava/java/util/jar/JarFile.java:563: error: Type
'PKCS7SignedData' not found in the declaration of the local variable
'sig'.
           PKCS7SignedData sig = (PKCS7SignedData) pkcs7Dsa.get(alias);
           ^
../../../llvm-gcc/libjava/java/util/jar/JarFile.java:627: error: Type
'SignerInfo' not found in the declaration of the argument 'signerInfo'
of method 'verify'.
     private void verify(Certificate certs, SignerInfo signerInfo,
                                              ^
4 errors
make[1]: *** [java/lang/Class.class] Error 1
make[1]: Leaving directory
`/home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava'
make: *** [all-target-libjava] Error 2

The java file gnu.java.security.pkcs.SignerInfo.java is not present in
/home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava (or any
other directory in the bootclasspath). I have libjava8-jar installed
in /usr/share/java. Could this problem be due to libjava8-jar on the
classpath ? (If so) How do I add /usr/share/java to the classpath and
pass it to the configure script ? Or is there something else that I am
missing ?

I am sorry if this question has been asked before, I searched the
archives a bit, but I could not find anything related to this.

Seems like you didn't give --enable-languages? I don't think java is a
supported language in llvm-gcc.

Best regards,
--Edwin

Thanks for the quick reply, Edwin.

I tried with --enable-languages=java and it still fails with the same error:

…/llvm-gcc/configure --enable-languages=java,c++,c --prefix=/usr/local
make ENABLE_OPTIMIZED=0

Actually I found that when I manually add /usr/share/java/libgcj-4.2.jar to the classpath to the failed command, it seems to work:

/home/pprabhu/llvm/llvm-objects/gcc/gcj -B/home/pprabhu/llvm/llvm-objects/gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include --encoding=UTF-8 -Wno-deprecated -C -g –classpath=/usr/share/java/libgcj-4.2.jar -bootclasspath /home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava’:‘…/…/…/llvm-gcc/libjava’:‘…/…/…/llvm-gcc/libjava/external/w3c_dom’:'…/…/…/llvm-gcc/libjava/external/sax -d /home/pprabhu/llvm/llvm-objects/i686-pc-linux-gnu/libjava …/…/…/llvm-gcc/libjava/java/lang/Class.java

But I am not sure if this is the right jar file that has to be passed (Is SignerInfo available somewhere within the llvm-gcc source distribution that I am failing to add to the configure script ? ) More generally, how do I pass some custom jar file to to the configure script, to be added to the class path of gcj ?

  • Prakash

Prakash Prabhu wrote:

Thanks for the quick reply, Edwin.

I tried with --enable-languages=java and it still fails with the same
error:

../llvm-gcc/configure --enable-languages=java,c++,c --prefix=/usr/local
make ENABLE_OPTIMIZED=0

Try without java. If you really need java, check out VMKit.

I configured like this:

../llvm-gcc4.2/configure
--prefix=/home/edwin/llvm-svn/obj42/../install --program-prefix=llvm-
--enable-llvm=/home/edwin/llvm-svn/llvm/ --disable-shared
--disable-multilib --disable-bootstrap --enable-languages=c,c++

I never tried building llvm-gcc with java enabled :wink:

Best regards,
--Edwin

Hello, Prakash

I tried with --enable-languages=java and it still fails with the same
error:

gcj is not supported by llvm-gcc (and even with build w/o LLVM, as
you're doing)

Thanks for your replies, Edwin and Anton. I finally got it to work by following Edwin’s configure command line and instructions in README.LLVM.

regards,
Prakash