* Forward declaration of classes needed when using GCJ? @ 2008-02-10 17:14 Andrew W 2008-02-11 17:50 ` David Daney 0 siblings, 1 reply; 17+ messages in thread From: Andrew W @ 2008-02-10 17:14 UTC (permalink / raw) To: gcc-help Consider the following two classes placed in files ./net/mydomain/core/ClassA.java and ./net/mydomain/core/ClassB.java respectively: package net.mydomain.core; public class ClassA { public static void main(String[] args) throws Exception { ClassB classb = new ClassB(); } } package net.mydomain.core; public class ClassB { } If I compile this using the 'normal' Java compiler like this: javac ./net/mydomain/core/ClassA.java ./net/mydomain/core/ClassB.java it works fine. Using the GCJ command: gcj --main=ClassA ./net/mydomain/core/ClassA.java ./net/mydomain/core/ClassB.java produces the error: ./net/mydomain/core/ClassA.java:8: error: Type ‘ClassB’ not found in the declaration of the local variable ‘classb’. ClassB classb = new ClassB(); Under C++ you would use an include of the header file for ClassB and a forward declaration to solve this, whats the solution for Java classes under GCJ? I should point out this is a compile-time syntax error not a linker error. Compiling ClassB separately and then passing it the .o file wont solve it. There needs to be some way of forward declaring ClassB inside ClassA.java. Thanks Andrew ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Forward declaration of classes needed when using GCJ? 2008-02-10 17:14 Forward declaration of classes needed when using GCJ? Andrew W @ 2008-02-11 17:50 ` David Daney [not found] ` <47B098D1.1050200@iee.org> 2008-02-11 21:56 ` Andrew W 0 siblings, 2 replies; 17+ messages in thread From: David Daney @ 2008-02-11 17:50 UTC (permalink / raw) To: Andrew W; +Cc: gcc-help Andrew W wrote: > Consider the following two classes placed in files > ./net/mydomain/core/ClassA.java and > ./net/mydomain/core/ClassB.java respectively: > > package net.mydomain.core; > public class ClassA > { > > public static void main(String[] args) throws Exception > { > ClassB classb = new ClassB(); > } > > } > > > package net.mydomain.core; > public class ClassB > { > > > } > > If I compile this using the 'normal' Java compiler like this: > javac ./net/mydomain/core/ClassA.java ./net/mydomain/core/ClassB.java > > it works fine. > > Using the GCJ command: > > gcj --main=ClassA ./net/mydomain/core/ClassA.java > ./net/mydomain/core/ClassB.java That should be: gcj --main=net.mydomain.core.ClassA ./net/mydomain/core/ClassA.java ./net/mydomain/core/ClassB.java David Daney ^ permalink raw reply [flat|nested] 17+ messages in thread
[parent not found: <47B098D1.1050200@iee.org>]
* Re: Forward declaration of classes needed when using GCJ? [not found] ` <47B098D1.1050200@iee.org> @ 2008-02-11 18:58 ` David Daney 0 siblings, 0 replies; 17+ messages in thread From: David Daney @ 2008-02-11 18:58 UTC (permalink / raw) To: Andrew W, gcc help Never respond directly to me. Keep the original mailing list(gcc-help@) on the CC list. Andrew W wrote: > Fair enough but that doesnt actually address the problem. Its ClassB it > doesnt like. > It likes it just fine. I successfully compiled your exact code on my Fedora Core 8 system using this command line: > > David Daney wrote: >> >> That should be: >> gcj --main=net.mydomain.core.ClassA ./net/mydomain/core/ClassA.java >> ./net/mydomain/core/ClassB.java >> David Daney ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Forward declaration of classes needed when using GCJ? 2008-02-11 17:50 ` David Daney [not found] ` <47B098D1.1050200@iee.org> @ 2008-02-11 21:56 ` Andrew W 2008-02-11 22:37 ` David Daney 1 sibling, 1 reply; 17+ messages in thread From: Andrew W @ 2008-02-11 21:56 UTC (permalink / raw) To: gcc-help Fair enough but that doesnt actually address the problem. Its ClassB it doesnt like. David Daney wrote: > > That should be: > gcj --main=net.mydomain.core.ClassA ./net/mydomain/core/ClassA.java > ./net/mydomain/core/ClassB.java > > David Daney > > ______________________________________________________________________ > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Forward declaration of classes needed when using GCJ? 2008-02-11 21:56 ` Andrew W @ 2008-02-11 22:37 ` David Daney 2008-02-12 16:02 ` Andrew W 0 siblings, 1 reply; 17+ messages in thread From: David Daney @ 2008-02-11 22:37 UTC (permalink / raw) To: Andrew W; +Cc: gcc-help Andrew W wrote: > Fair enough but that doesnt actually address the problem. Its ClassB it > doesnt like. > You are probably using an older gcj. You didn't say which version. Try setting the classpath for gcj, perhaps it cannot find the other class. David Daney > David Daney wrote: >> >> That should be: >> gcj --main=net.mydomain.core.ClassA ./net/mydomain/core/ClassA.java >> ./net/mydomain/core/ClassB.java >> >> David Daney >> >> ______________________________________________________________________ >> > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Forward declaration of classes needed when using GCJ? 2008-02-11 22:37 ` David Daney @ 2008-02-12 16:02 ` Andrew W 2008-02-12 17:48 ` Andrew Haley 2008-02-15 18:24 ` Andrew W 0 siblings, 2 replies; 17+ messages in thread From: Andrew W @ 2008-02-12 16:02 UTC (permalink / raw) To: gcc-help Interesting you got it to work with Fedora. Im using the version that comes with Ubuntu 7.04 which is has the version string. gcj (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu5) Thanks David Andrew ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Forward declaration of classes needed when using GCJ? 2008-02-12 16:02 ` Andrew W @ 2008-02-12 17:48 ` Andrew Haley 2008-02-15 18:24 ` Andrew W 1 sibling, 0 replies; 17+ messages in thread From: Andrew Haley @ 2008-02-12 17:48 UTC (permalink / raw) To: Andrew W; +Cc: gcc-help Andrew W wrote: > Interesting you got it to work with Fedora. > Im using the version that comes with Ubuntu 7.04 which is has the > version string. > > gcj (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu5) Works for me too: zebedee:~ $ gcj --main=net.mydomain.core.ClassA ./net/mydomain/core/ClassA.java ./net/mydomain/core/ClassB.java zebedee:~ $ gcj --version gcj (GCC) 4.1.2 Copyright (C) 2006 Free Software Foundation, Inc. Andrew. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Forward declaration of classes needed when using GCJ? 2008-02-12 16:02 ` Andrew W 2008-02-12 17:48 ` Andrew Haley @ 2008-02-15 18:24 ` Andrew W 2008-02-15 18:31 ` Building cross compiler for x86_64 Frank W. Miller 2008-02-15 19:51 ` Forward declaration of classes needed when using GCJ? Andrew Haley 1 sibling, 2 replies; 17+ messages in thread From: Andrew W @ 2008-02-15 18:24 UTC (permalink / raw) To: gcc-help OK I've solved the problem when you've just got the two simple classes A & B. It seems is obscurely fussy about the current working directory. It insists the current directory is the root of the project and you specify the .java files as a sub path below that it will NOT allow you to have the package dir containing the .java files as the current directory. i.e cd /path/to/project gcj --main=net.mydomain.core.ClassA ./net/mydomain/core/ClassA.java ./net/mydomain/core/ClassB.java WILL work cd /path/to/project/net/mydomain/core/ gcj --main=net.mydomain.core.ClassA ./ClassA.java ./ClassB.java will NOT Anyway. If you then try linking against jar files using --classpath= you're back to square 1. Taking the above example (the 1st one) if you copy any .JAR file to /path/to/project/ then do gcj --main=net.mydomain.core.ClassA ./net/mydomain/core/ClassA.java ./net/mydomain/core/ClassB.java --classpath='./lo4j-1.2.8.jar' you get the same error about not recognising ClassB. Even appending the current dir onto the end of the classpath doesnt solve it. Any ideas? Regards Andrew ^ permalink raw reply [flat|nested] 17+ messages in thread
* Building cross compiler for x86_64 2008-02-15 18:24 ` Andrew W @ 2008-02-15 18:31 ` Frank W. Miller 2008-02-16 0:00 ` Brian Dessent 2008-02-16 20:06 ` Frank W. Miller 2008-02-15 19:51 ` Forward declaration of classes needed when using GCJ? Andrew Haley 1 sibling, 2 replies; 17+ messages in thread From: Frank W. Miller @ 2008-02-15 18:31 UTC (permalink / raw) To: gcc-help OK, so I'm off trying to build the x86_64 cross toolchain. My host is FC8 on a PC. binutils-2.18 builds fine. configure --target=x86_64-elf make make install This gets me a nice set of tools in /usr/local/x86_64-elf/bin I then try to build gcc-4.2.3 I tried: configure --prefix=/usr/local --target=x86_64-elf make all-gcc This gets me an error saying x86_64-elf is not a supported target. I think tried substituting make all-gcc with make -k (after deleting the source tree and starting over). I get this error somewhere down the line: source='../.././libdecnumber/decimal128.c' object='decimal128.o' libtool=no gcc -I../.././libdecnumber -I. -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -pedantic -Wno-long-long -I../.././libdecnumber -I. -c ../.././libdecnumber/decimal128.c rm -f libdecnumber.a ar cru libdecnumber.a decNumber.o decContext.o decUtility.o decimal32.o decimal64.o decimal128.o ranlib libdecnumber.a make[2]: Leaving directory `/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/libdecnumber' make[1]: Target `all-host' not remade because of errors. make[1]: Target `all-target' not remade because of errors. make[1]: Leaving directory `/home/fwmiller/Desktop/gcc-4.2.3' make: *** [all] Error 2 Can anyone comment? Thanks, FM ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Building cross compiler for x86_64 2008-02-15 18:31 ` Building cross compiler for x86_64 Frank W. Miller @ 2008-02-16 0:00 ` Brian Dessent 2008-02-16 0:14 ` Frank W. Miller 2008-02-16 20:06 ` Frank W. Miller 1 sibling, 1 reply; 17+ messages in thread From: Brian Dessent @ 2008-02-16 0:00 UTC (permalink / raw) To: Frank W. Miller; +Cc: gcc-help "Frank W. Miller" wrote: > This gets me an error saying x86_64-elf is not a supported target. I I think you'll need to use a more recent version. The support for bare metal x86_64 wasn't added until r127798: <http://gcc.gnu.org/viewcvs?view=rev&revision=127798>. You could probably just apply that patch to whatever version you're using. > source tree and starting over). I get this error somewhere down the > line: > > source='../.././libdecnumber/decimal128.c' object='decimal128.o' > libtool=no gcc -I../.././libdecnumber -I. -g -O2 -W -Wall > -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes > -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -pedantic > -Wno-long-long -I../.././libdecnumber -I. > -c ../.././libdecnumber/decimal128.c > rm -f libdecnumber.a > ar cru libdecnumber.a decNumber.o decContext.o decUtility.o decimal32.o > decimal64.o decimal128.o > ranlib libdecnumber.a > make[2]: Leaving directory > `/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/libdecnumber' > make[1]: Target `all-host' not remade because of errors. > make[1]: Target `all-target' not remade because of errors. > make[1]: Leaving directory `/home/fwmiller/Desktop/gcc-4.2.3' > make: *** [all] Error 2 That's not the error per se. The actual error was earlier in the process, but because of -k it kept continuing to build things that didn't depend on the makefile target that errored. So the above doesn't really say anything, other than that something went wrong earlier. BTW you're definitely going to want to disable things like libmudflap, libssp, libdecnumber, libgomp, etc. if any of them turn out to be enabled by default. Brian ^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: Building cross compiler for x86_64 2008-02-16 0:00 ` Brian Dessent @ 2008-02-16 0:14 ` Frank W. Miller 2008-02-16 0:33 ` Brian Dessent 0 siblings, 1 reply; 17+ messages in thread From: Frank W. Miller @ 2008-02-16 0:14 UTC (permalink / raw) To: 'gcc-help' Thanks for the reply. I'm building 4.2.3 which was release on 2/1/08, 2 weeks ago. Are you saying there a more recent version that has that in it? I'll send another email without the -k so it bombs at the first error. How do I disable the building of the libs you are mentioning? Thanks, FM -----Original Message----- From: Brian Dessent [mailto:brian@dessent.net] Sent: Friday, February 15, 2008 4:59 PM To: Frank W. Miller Cc: gcc-help Subject: Re: Building cross compiler for x86_64 "Frank W. Miller" wrote: > This gets me an error saying x86_64-elf is not a supported target. I I think you'll need to use a more recent version. The support for bare metal x86_64 wasn't added until r127798: <http://gcc.gnu.org/viewcvs?view=rev&revision=127798>. You could probably just apply that patch to whatever version you're using. > source tree and starting over). I get this error somewhere down the > line: > > source='../.././libdecnumber/decimal128.c' object='decimal128.o' > libtool=no gcc -I../.././libdecnumber -I. -g -O2 -W -Wall > -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes > -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -pedantic > -Wno-long-long -I../.././libdecnumber -I. > -c ../.././libdecnumber/decimal128.c > rm -f libdecnumber.a > ar cru libdecnumber.a decNumber.o decContext.o decUtility.o decimal32.o > decimal64.o decimal128.o > ranlib libdecnumber.a > make[2]: Leaving directory > `/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/libdecnumber' > make[1]: Target `all-host' not remade because of errors. > make[1]: Target `all-target' not remade because of errors. > make[1]: Leaving directory `/home/fwmiller/Desktop/gcc-4.2.3' > make: *** [all] Error 2 That's not the error per se. The actual error was earlier in the process, but because of -k it kept continuing to build things that didn't depend on the makefile target that errored. So the above doesn't really say anything, other than that something went wrong earlier. BTW you're definitely going to want to disable things like libmudflap, libssp, libdecnumber, libgomp, etc. if any of them turn out to be enabled by default. Brian ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Building cross compiler for x86_64 2008-02-16 0:14 ` Frank W. Miller @ 2008-02-16 0:33 ` Brian Dessent 0 siblings, 0 replies; 17+ messages in thread From: Brian Dessent @ 2008-02-16 0:33 UTC (permalink / raw) To: Frank W. Miller; +Cc: 'gcc-help' "Frank W. Miller" wrote: > I'm building 4.2.3 which was release on 2/1/08, 2 weeks ago. Are you saying > there a more recent version that has that in it? Oh, right, I see how that would be confusing. That patch was to the trunk, and since it isn't a regression it probably will never be backported to any branches so it won't be in any 4.2 release. You can try applying the change yourself to 4.2, you can try a 4.3 snapshot, or abandon the idea of using the bare metal target and pick an existing target that is just "close enough" to whatever kernel you're using. It seems rather hackish to me to build a e.g. linux targeted compiler if the target isn't linux at all, but if it's just for doing purely freestanding code I suppose it wouldn't be too wrong. > How do I disable the building of the libs you are mentioning? Each of those can be specified as e.g. --disable-libmudflap. Brian ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Building cross compiler for x86_64 2008-02-15 18:31 ` Building cross compiler for x86_64 Frank W. Miller 2008-02-16 0:00 ` Brian Dessent @ 2008-02-16 20:06 ` Frank W. Miller 2008-02-17 2:52 ` Brian Dessent 1 sibling, 1 reply; 17+ messages in thread From: Frank W. Miller @ 2008-02-16 20:06 UTC (permalink / raw) To: gcc-help I tried recompiling both binutils and gcc using x86_64 as the target as follows: binutils: configure --target=x86_64-pc-linux make make install This works fine. Then gcc: configure --prefix=/usr/local --target=x86_64-pc-linux --enable-languages="c" make all-gcc This fails. I get the following error: /home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/gcc/xgcc -B/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/gcc/ -B/usr/local/x86_64-pc-linux/bin/ -B/usr/local/x86_64-pc-linux/lib/ -isystem /usr/local/x86_64-pc-linux/include -isystem /usr/local/x86_64-pc-linux/sys-include -O2 -O2 -g -O2 -DIN_GCC -DCROSS_COMPILE -DNATIVE_CROSS -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../.././gcc -I../.././gcc/. -I../.././gcc/../include -I../.././gcc/../libcpp/include -I../.././gcc/../libdecnumber -I../libdecnumber -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c ../.././gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o In file included from ./gthr-default.h:1, from ../.././gcc/gthr.h:114, from ../.././gcc/unwind-dw2.c:42: ../.././gcc/gthr-posix.h:43:21: error: pthread.h: No such file or directory ../.././gcc/gthr-posix.h:44:20: error: unistd.h: No such file or directory In file included from ./gthr-default.h:1, from ../.././gcc/gthr.h:114, from ../.././gcc/unwind-dw2.c:42: ../.././gcc/gthr-posix.h:46: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â__gthread_key_tâ ../.././gcc/gthr-posix.h:47: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â__gthread_once_tâ ../.././gcc/gthr-posix.h:48: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â__gthread_mutex_tâ ../.././gcc/gthr-posix.h:49: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â__gthread_recursive_mutex_tâ ../.././gcc/gthr-posix.h:92: error: âpthread_onceâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:92: warning: type defaults to âintâ in declaration of â__gthrw_pthread_onceâ ../.././gcc/gthr-posix.h:93: error: âpthread_getspecificâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:93: warning: type defaults to âintâ in declaration of â__gthrw_pthread_getspecificâ ../.././gcc/gthr-posix.h:94: error: âpthread_setspecificâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:94: warning: type defaults to âintâ in declaration of â__gthrw_pthread_setspecificâ ../.././gcc/gthr-posix.h:95: error: âpthread_createâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:95: warning: type defaults to âintâ in declaration of â__gthrw_pthread_createâ ../.././gcc/gthr-posix.h:96: error: âpthread_cancelâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:96: warning: type defaults to âintâ in declaration of â__gthrw_pthread_cancelâ ../.././gcc/gthr-posix.h:97: error: âpthread_mutex_lockâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:97: warning: type defaults to âintâ in declaration of â__gthrw_pthread_mutex_lockâ ../.././gcc/gthr-posix.h:98: error: âpthread_mutex_trylockâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:98: warning: type defaults to âintâ in declaration of â__gthrw_pthread_mutex_trylockâ ../.././gcc/gthr-posix.h:99: error: âpthread_mutex_unlockâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:99: warning: type defaults to âintâ in declaration of â__gthrw_pthread_mutex_unlockâ ../.././gcc/gthr-posix.h:100: error: âpthread_mutex_initâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:100: warning: type defaults to âintâ in declaration of â__gthrw_pthread_mutex_initâ ../.././gcc/gthr-posix.h:103: error: âpthread_key_createâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:103: warning: type defaults to âintâ in declaration of â__gthrw_pthread_key_createâ ../.././gcc/gthr-posix.h:104: error: âpthread_key_deleteâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:104: warning: type defaults to âintâ in declaration of â__gthrw_pthread_key_deleteâ ../.././gcc/gthr-posix.h:105: error: âpthread_mutexattr_initâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:105: warning: type defaults to âintâ in declaration of â__gthrw_pthread_mutexattr_initâ ../.././gcc/gthr-posix.h:106: error: âpthread_mutexattr_settypeâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:106: warning: type defaults to âintâ in declaration of â__gthrw_pthread_mutexattr_settypeâ ../.././gcc/gthr-posix.h:107: error: âpthread_mutexattr_destroyâ undeclared here (not in a function) ../.././gcc/gthr-posix.h:107: warning: type defaults to âintâ in declaration of â__gthrw_pthread_mutexattr_destroyâ ../.././gcc/gthr-posix.h:572: error: expected â)â before â*â token ../.././gcc/gthr-posix.h:581: error: expected â)â before â*â token ../.././gcc/gthr-posix.h:587: error: expected â)â before âkeyâ ../.././gcc/gthr-posix.h:593: error: expected â)â before âkeyâ ../.././gcc/gthr-posix.h:599: error: expected â)â before âkeyâ ../.././gcc/gthr-posix.h:605: error: expected â)â before â*â token ../.././gcc/gthr-posix.h:614: error: expected â)â before â*â token ../.././gcc/gthr-posix.h:623: error: expected â)â before â*â token ../.././gcc/gthr-posix.h:633: error: expected â)â before â*â token ../.././gcc/gthr-posix.h:654: error: expected â)â before â*â token ../.././gcc/gthr-posix.h:660: error: expected â)â before â*â token ../.././gcc/gthr-posix.h:666: error: expected â)â before â*â token ../.././gcc/unwind-dw2.c: In function âuw_init_context_1â: ../.././gcc/unwind-dw2.c:1417: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âonce_regsizesâ ../.././gcc/unwind-dw2.c:1417: error: âonce_regsizesâ undeclared (first use in this function) ../.././gcc/unwind-dw2.c:1417: error: (Each undeclared identifier is reported only once ../.././gcc/unwind-dw2.c:1417: error: for each function it appears in.) ../.././gcc/unwind-dw2.c:1417: error: âPTHREAD_ONCE_INITâ undeclared (first use in this function) ../.././gcc/unwind-dw2.c:1418: warning: implicit declaration of function â__gthread_onceâ make[2]: *** [libgcc/./unwind-dw2.o] Error 1 make[2]: Leaving directory `/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/gcc' make[1]: *** [stmp-multilib] Error 2 make[1]: Leaving directory `/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/gcc' make: *** [all-gcc] Error 2 Thoughts? FM On Fri, 2008-02-15 at 11:30 -0700, Frank W. Miller wrote: > OK, so I'm off trying to build the x86_64 cross toolchain. My host is > FC8 on a PC. > > binutils-2.18 builds fine. > > configure --target=x86_64-elf > make > make install > > This gets me a nice set of tools in /usr/local/x86_64-elf/bin > > I then try to build gcc-4.2.3 > > I tried: > > configure --prefix=/usr/local --target=x86_64-elf > make all-gcc > > This gets me an error saying x86_64-elf is not a supported target. I > think tried substituting make all-gcc with make -k (after deleting the > source tree and starting over). I get this error somewhere down the > line: > > source='../.././libdecnumber/decimal128.c' object='decimal128.o' > libtool=no gcc -I../.././libdecnumber -I. -g -O2 -W -Wall > -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes > -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -pedantic > -Wno-long-long -I../.././libdecnumber -I. > -c ../.././libdecnumber/decimal128.c > rm -f libdecnumber.a > ar cru libdecnumber.a decNumber.o decContext.o decUtility.o decimal32.o > decimal64.o decimal128.o > ranlib libdecnumber.a > make[2]: Leaving directory > `/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/libdecnumber' > make[1]: Target `all-host' not remade because of errors. > make[1]: Target `all-target' not remade because of errors. > make[1]: Leaving directory `/home/fwmiller/Desktop/gcc-4.2.3' > make: *** [all] Error 2 > > > Can anyone comment? > > Thanks, > FM > > > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Building cross compiler for x86_64 2008-02-16 20:06 ` Frank W. Miller @ 2008-02-17 2:52 ` Brian Dessent 2008-02-17 2:55 ` NightStrike 0 siblings, 1 reply; 17+ messages in thread From: Brian Dessent @ 2008-02-17 2:52 UTC (permalink / raw) To: Frank W. Miller; +Cc: gcc-help "Frank W. Miller" wrote: > /home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/gcc/xgcc > -B/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/gcc/ > -B/usr/local/x86_64-pc-linux/bin/ -B/usr/local/x86_64-pc-linux/lib/ > -isystem /usr/local/x86_64-pc-linux/include > -isystem /usr/local/x86_64-pc-linux/sys-include -O2 -O2 -g -O2 > -DIN_GCC -DCROSS_COMPILE -DNATIVE_CROSS -W -Wall -Wwrite-strings > -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition > -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 > -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../.././gcc > -I../.././gcc/. -I../.././gcc/../include -I../.././gcc/../libcpp/include > -I../.././gcc/../libdecnumber -I../libdecnumber -fexceptions > -fvisibility=hidden -DHIDE_EXPORTS -c ../.././gcc/unwind-dw2.c -o > libgcc/./unwind-dw2.o This is the stage 3 compiler being used to build libgcc, and: > ../.././gcc/gthr-posix.h:43:21: error: pthread.h: No such file or > directory > ../.././gcc/gthr-posix.h:44:20: error: unistd.h: No such file or > directory ... like I said, you can't build libgcc without target libc headers. I don't know why the all-gcc rule still tries to build parts of libgcc. But you already have the bare compiler built at this point so for freestanding work that should be enough. You can try something like "make -k install-gcc" and see what happens, or do it manually. Brian ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Building cross compiler for x86_64 2008-02-17 2:52 ` Brian Dessent @ 2008-02-17 2:55 ` NightStrike 2008-02-18 4:39 ` Frank W. Miller 0 siblings, 1 reply; 17+ messages in thread From: NightStrike @ 2008-02-17 2:55 UTC (permalink / raw) To: gcc-help; +Cc: Frank W. Miller On Feb 16, 2008 9:51 PM, Brian Dessent <brian@dessent.net> wrote: > ... like I said, you can't build libgcc without target libc headers. I > don't know why the all-gcc rule still tries to build parts of libgcc. What parts does it try to build? ^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: Building cross compiler for x86_64 2008-02-17 2:55 ` NightStrike @ 2008-02-18 4:39 ` Frank W. Miller 0 siblings, 0 replies; 17+ messages in thread From: Frank W. Miller @ 2008-02-18 4:39 UTC (permalink / raw) To: 'NightStrike', 'gcc-help' I just need the C cross compiler and binutils, nothing else. Thanks, FM -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of NightStrike Sent: Saturday, February 16, 2008 7:56 PM To: gcc-help Cc: Frank W. Miller Subject: Re: Building cross compiler for x86_64 On Feb 16, 2008 9:51 PM, Brian Dessent <brian@dessent.net> wrote: > ... like I said, you can't build libgcc without target libc headers. I > don't know why the all-gcc rule still tries to build parts of libgcc. What parts does it try to build? ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Forward declaration of classes needed when using GCJ? 2008-02-15 18:24 ` Andrew W 2008-02-15 18:31 ` Building cross compiler for x86_64 Frank W. Miller @ 2008-02-15 19:51 ` Andrew Haley 1 sibling, 0 replies; 17+ messages in thread From: Andrew Haley @ 2008-02-15 19:51 UTC (permalink / raw) To: Andrew W; +Cc: gcc-help Andrew W wrote: > If you then try linking against jar files using --classpath= you're back > to square 1. > > Taking the above example (the 1st one) if you copy any .JAR file to > /path/to/project/ > > then do > > gcj --main=net.mydomain.core.ClassA ./net/mydomain/core/ClassA.java > ./net/mydomain/core/ClassB.java --classpath='./lo4j-1.2.8.jar' > > you get the same error about not recognising ClassB. > > Even appending the current dir onto the end of the classpath doesnt > solve it. > > Any ideas? Last time, two of us tried to duplicate your problem and failed. It seems that you didn't really describe what your problem actually was, so it worked for us but not for you. Could you please produce a test case, in a tarfile that we can upack, and the exact command that you want us to try? That way, we'll at least be doing the same thing. Also, we need to know which version of gcj you used. Andrew. ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2008-02-18 4:39 UTC | newest] Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-02-10 17:14 Forward declaration of classes needed when using GCJ? Andrew W 2008-02-11 17:50 ` David Daney [not found] ` <47B098D1.1050200@iee.org> 2008-02-11 18:58 ` David Daney 2008-02-11 21:56 ` Andrew W 2008-02-11 22:37 ` David Daney 2008-02-12 16:02 ` Andrew W 2008-02-12 17:48 ` Andrew Haley 2008-02-15 18:24 ` Andrew W 2008-02-15 18:31 ` Building cross compiler for x86_64 Frank W. Miller 2008-02-16 0:00 ` Brian Dessent 2008-02-16 0:14 ` Frank W. Miller 2008-02-16 0:33 ` Brian Dessent 2008-02-16 20:06 ` Frank W. Miller 2008-02-17 2:52 ` Brian Dessent 2008-02-17 2:55 ` NightStrike 2008-02-18 4:39 ` Frank W. Miller 2008-02-15 19:51 ` Forward declaration of classes needed when using GCJ? Andrew Haley
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).