[patch] include the %I spec when building the object file for the main function

Matthias Klose <[email protected]>
Newsgroups gmane.comp.gcc.java.patches
Message-ID <[email protected]>
I recently did see a libjava build failure with glibc-2.17, of the form:

libtool: link:
/build/buildd-gcj-4.8_4.8.0-2-armel-YVuMIc/gcj-4.8-4.8.0/build/./gcc/gcj
-B/build/buildd-gcj-4.8_4.8.0-2-armel-YVuMIc/gcj-4.8-4.8.0/build/arm-linux-gnueabi/libjava/
-B/build/buildd-gcj-4.8_4.8.0-2-armel-YVuMIc/gcj-4.8-4.8.0/build/./gcc/
-B/usr/arm-linux-gnueabi/bin/ -B/usr/arm-linux-gnueabi/lib/ -isystem
/usr/arm-linux-gnueabi/include -isystem /usr/arm-linux-gnueabi/sys-include -g
-O2 -o .libs/jv-convert --main=gnu.gcj.convert.Convert -shared-libgcc
-Wl,--no-merge-exidx-entries
-L/build/buildd-gcj-4.8_4.8.0-2-armel-YVuMIc/gcj-4.8-4.8.0/build/arm-linux-gnueabi/libjava/.libs
-L/build/buildd-gcj-4.8_4.8.0-2-armel-YVuMIc/gcj-4.8-4.8.0/build/arm-linux-gnueabi/libjava
-L/build/buildd-gcj-4.8_4.8.0-2-armel-YVuMIc/gcj-4.8-4.8.0/build/arm-linux-gnueabi/libjava/../libstdc++-v3/src/.libs
/build/buildd-gcj-4.8_4.8.0-2-armel-YVuMIc/gcj-4.8-4.8.0/build/arm-linux-gnueabi/libjava/../libstdc++-v3/src/.libs/libstdc++.so
./.libs/libgcj.so
/build/buildd-gcj-4.8_4.8.0-2-armel-YVuMIc/gcj-4.8-4.8.0/build/arm-linux-gnueabi/libstdc++-v3/src/.libs/libstdc++.so
-lm -lpthread -lrt -ldl -lz -Wl,-rpath -Wl,/usr/lib/arm-linux-gnueabi
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such file or
directory
 #include <bits/predefs.h>
                          ^
compilation terminated.
make[5]: *** [jv-convert] Error 1

The inclusion of stdc-predef.h is new in 4.8, the bits/predefs.h is not found in
my case, because this header is on an include path, which is only added when cc1
is passed the -imultiarch <tuple> option.  The solution for me is to add the %I
spec, when calling cc1 to build the main function.

Ok for the trunk, and for 4.8 after the 4.8.1 release?

  Matthias
jvspec.diff (text/plain, 416 B)
	* jvspec.c (jvgenmain_spec): Add %I to cc1 call.

--- a/src/gcc/java/jvspec.c
+++ b/src/gcc/java/jvspec.c
@@ -59,7 +59,7 @@
   "jvgenmain %{findirect-dispatch} %{D*} %b %m.i |\n\
    cc1 %m.i %1 \
 		   %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*}\
-		   %{g*} %{O*} \
+		   %{g*} %{O*} %I \
 		   %{v:-version} %{pg:-p} %{p}\
 		   %<fbounds-check %<fno-bounds-check\
 		   %<fassume-compiled* %<fno-assume-compiled*\
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.