|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
|
|
bootstrapping gnat GCC on amd64Hello.
I'm attempting to compile GNAT on AMD64 with an eye to extending support to the platform (the gnat-gcc43 port is ONLY_FOR_ARCH=i386). GNAT obviously requires an Ada compiler to bootstrap. What are my options here? I suspect that I need to create an i386 jail to build a cross compiler but am not sure. Any help would be appreciated. xw _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On Mon, 4 May 2009, xorquewasp@... wrote:
> Hello. > > I'm attempting to compile GNAT on AMD64 with an eye to > extending support to the platform (the gnat-gcc43 port > is ONLY_FOR_ARCH=i386). > > GNAT obviously requires an Ada compiler to bootstrap. > > What are my options here? > > I suspect that I need to create an i386 jail to build > a cross compiler but am not sure. Is that your only system (amd64)? I originally ported GNAT to FreeBSD x86 from a solaris-sparc32 system. I built a sparc-sun-freebsd GNAT cross compiler using the native Solaris GNAT binary and its associated sources. I also (first) had to cross build binutils similarly. This made a cross compiler that ran on Solaris and built ELF binaries for FreeBSD. I then used this cross compiler to rebuild GNAT as a FreeBSD binary. So it was 2 major steps: build a cross compiler, then use the cross to build a native compiler. It's been years since I've done that. I don't know how much has changed, but you probably have to do something similar. -- DE _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On 2009-05-04 14:44:52, Daniel Eischen wrote:
> Is that your only system (amd64)? I originally > ported GNAT to FreeBSD x86 from a solaris-sparc32 system. > I built a sparc-sun-freebsd GNAT cross compiler using > the native Solaris GNAT binary and its associated > sources. I also (first) had to cross build binutils > similarly. This made a cross compiler that ran on > Solaris and built ELF binaries for FreeBSD. I then > used this cross compiler to rebuild GNAT as a FreeBSD > binary. So it was 2 major steps: build a cross compiler, > then use the cross to build a native compiler. > > It's been years since I've done that. I don't know > how much has changed, but you probably have to do > something similar. > > -- > DE Hello. I have a debian system with a working x86 gnat gcc 4.3.3 and a freebsd x86 system running gnat gcc 4.3.2. I guess the first step will be an i386->amd64 cross compiler then. Thanks, xw _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On Mon, 4 May 2009, xorquewasp@... wrote:
> On 2009-05-04 14:44:52, Daniel Eischen wrote: >> Is that your only system (amd64)? I originally >> ported GNAT to FreeBSD x86 from a solaris-sparc32 system. >> I built a sparc-sun-freebsd GNAT cross compiler using >> the native Solaris GNAT binary and its associated >> sources. I also (first) had to cross build binutils >> similarly. This made a cross compiler that ran on >> Solaris and built ELF binaries for FreeBSD. I then >> used this cross compiler to rebuild GNAT as a FreeBSD >> binary. So it was 2 major steps: build a cross compiler, >> then use the cross to build a native compiler. >> >> It's been years since I've done that. I don't know >> how much has changed, but you probably have to do >> something similar. >> >> -- >> DE > > Hello. > > I have a debian system with a working x86 gnat gcc 4.3.3 > and a freebsd x86 system running gnat gcc 4.3.2. > > I guess the first step will be an i386->amd64 cross > compiler then. Right, you should be able to do it from either of those, but perhaps the freebsd x86 may be easier. I would use a PREFIX other than /usr/local (or something different than whatever your actual PREFIX is) for the builds. I was looking around for my notes but can't find them. If I do find them, I'll post them. -- DE _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On 2009-05-04 15:03:32, Daniel Eischen wrote:
> Right, you should be able to do it from either of those, > but perhaps the freebsd x86 may be easier. > > I would use a PREFIX other than /usr/local (or something > different than whatever your actual PREFIX is) for the > builds. > > I was looking around for my notes but can't find them. > If I do find them, I'll post them. I've built an i386 jail and am currently building the gnat-gcc43 port to compile a GNAT cross-compiler (i386 -> amd64). There are two reasons for this whole exercise: I just moved over to amd64 and want a native toolchain and I also have a lot of software written in Ada that I'd like to submit to FreeBSD ports but can't due a lack of an Ada compiler on amd64. I noticed that the gnat-gcc43 port downloads a rather anonymous set of gcc 4.1 bootstrap binaries. I assume I'd have to provide my own in the same manner to create a port? xw _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On Tue, 5 May 2009, xorquewasp@... wrote:
> On 2009-05-04 15:03:32, Daniel Eischen wrote: >> Right, you should be able to do it from either of those, >> but perhaps the freebsd x86 may be easier. >> >> I would use a PREFIX other than /usr/local (or something >> different than whatever your actual PREFIX is) for the >> builds. >> >> I was looking around for my notes but can't find them. >> If I do find them, I'll post them. > > I've built an i386 jail and am currently building the > gnat-gcc43 port to compile a GNAT cross-compiler (i386 -> > amd64). > > There are two reasons for this whole exercise: I just moved > over to amd64 and want a native toolchain and I also have a > lot of software written in Ada that I'd like to submit to > FreeBSD ports but can't due a lack of an Ada compiler on amd64. > > I noticed that the gnat-gcc43 port downloads a rather > anonymous set of gcc 4.1 bootstrap binaries. I assume I'd > have to provide my own in the same manner to create a port? Yes, you can look at my lang/gnat port to find its bootstrap compiler. I would recommend making a binary bootstrap compiler on the earliest version of FreeBSD amd64 as you can. If you use 8.0-current for instance, others will not be able to build the port on 7.x. -- DE _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On 2009-05-04 20:54:46, Daniel Eischen wrote:
> Yes, you can look at my lang/gnat port to find its > bootstrap compiler. I would recommend making a binary > bootstrap compiler on the earliest version of FreeBSD > amd64 as you can. If you use 8.0-current for instance, > others will not be able to build the port on 7.x. Earliest version of FreeBSD that fully supports this hardware is 7.2, so I personally can't go back to an earlier release than that. _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On Tue, 5 May 2009, xorquewasp@... wrote:
> On 2009-05-04 20:54:46, Daniel Eischen wrote: >> Yes, you can look at my lang/gnat port to find its >> bootstrap compiler. I would recommend making a binary >> bootstrap compiler on the earliest version of FreeBSD >> amd64 as you can. If you use 8.0-current for instance, >> others will not be able to build the port on 7.x. > > Earliest version of FreeBSD that fully supports this > hardware is 7.2, so I personally can't go back to an > earlier release than that. Keep good notes - maybe someone else can do it once you have the procedure down and working ;-) -- DE _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
|
|
|
|
|
|
Re: bootstrapping gnat GCC on amd64Hi.
After a week off, another update: I've realised, too late, that I'm using a version of binutils (2.19) that's incompatible with the system binutils (2.15). Specifically, assembler code emitted by the native GNAT contains .cfi_personality directives (and no doubt other things too) that can't be processed by the system 'as'. I've got two choices now and would appreciate some advice on which to take given that I want to produce a FreeBSD port: 1. Compile binutils-2.15. Unfortunately, compiling these as cross-binutils appear to be problematic: gmake[3]: Entering directory `/root/memfs/c1-bu-obj/gas' gcc -DHAVE_CONFIG_H -I. -I/root/binutils-2.15/gas -I. -D_GNU_SOURCE -I. -I/root/binutils-2.15/gas -I../bfd -I/root/binutils-2.15/gas/config -I/root/binutils-2.15/gas/../include -I/root/binutils-2.15/gas/.. -I/root/binutils-2.15/gas/../bfd -I/root/binutils-2.15/gas/../intl -I../intl -DLOCALEDIR="\"/cross/x86_64/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c /root/binutils-2.15/gas/app.c In file included from /root/binutils-2.15/gas/as.h:94, from /root/binutils-2.15/gas/app.c:30: /root/binutils-2.15/gas/../include/getopt.h:116: warning: function declaration isn't a prototype In file included from ./targ-cpu.h:1, from /root/binutils-2.15/gas/config/obj-elf.h:42, from ./obj-format.h:1, from /root/binutils-2.15/gas/config/te-freebsd.h:30, from ./targ-env.h:1, from /root/binutils-2.15/gas/as.h:626, from /root/binutils-2.15/gas/app.c:30: /root/binutils-2.15/gas/config/tc-i386.h:451: error: array type has incomplete element type gmake[3]: *** [app.o] Error 1 gmake[3]: Leaving directory `/root/memfs/c1-bu-obj/gas' gmake[2]: *** [all-recursive] Error 1 gmake[2]: Leaving directory `/root/memfs/c1-bu-obj/gas' gmake[1]: *** [all] Error 2 gmake[1]: Leaving directory `/root/memfs/c1-bu-obj/gas' gmake: *** [all-gas] Error 2 2. Continue to use binutils-2.19. This would appear to require me to create a binutils-2.19 port just for the GNAT compiler. Seems like it would be preferable to use the system binutils rather than to take this route... xw _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On 2009-05-18 09:48:31, xorquewasp@... wrote:
> 1. Compile binutils-2.15. > > Unfortunately, compiling these as cross-binutils appear to be problematic: > > gmake[3]: Entering directory `/root/memfs/c1-bu-obj/gas' > gcc -DHAVE_CONFIG_H -I. -I/root/binutils-2.15/gas -I. -D_GNU_SOURCE -I. -I/root/binutils-2.15/gas -I../bfd -I/root/binutils-2.15/gas/config -I/root/binutils-2.15/gas/../include -I/root/binutils-2.15/gas/.. -I/root/binutils-2.15/gas/../bfd -I/root/binutils-2.15/gas/../intl -I../intl -DLOCALEDIR="\"/cross/x86_64/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c /root/binutils-2.15/gas/app.c > In file included from /root/binutils-2.15/gas/as.h:94, > from /root/binutils-2.15/gas/app.c:30: > /root/binutils-2.15/gas/../include/getopt.h:116: warning: function declaration isn't a prototype > In file included from ./targ-cpu.h:1, > from /root/binutils-2.15/gas/config/obj-elf.h:42, > from ./obj-format.h:1, > from /root/binutils-2.15/gas/config/te-freebsd.h:30, > from ./targ-env.h:1, > from /root/binutils-2.15/gas/as.h:626, > from /root/binutils-2.15/gas/app.c:30: > /root/binutils-2.15/gas/config/tc-i386.h:451: error: array type has incomplete element type > gmake[3]: *** [app.o] Error 1 > gmake[3]: Leaving directory `/root/memfs/c1-bu-obj/gas' > gmake[2]: *** [all-recursive] Error 1 > gmake[2]: Leaving directory `/root/memfs/c1-bu-obj/gas' > gmake[1]: *** [all] Error 2 > gmake[1]: Leaving directory `/root/memfs/c1-bu-obj/gas' > gmake: *** [all-gas] Error 2 Correction. Will compile with patches from here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=299671 But doesn't pass test suite: # of expected passes 28 # of unexpected failures 20 Test logs show: Executing /root/binutils-2.15/gas/testsuite/lib/run ../as-new --32 -al /root/binutils-2.15/gas/testsuite/gas/i386/float.s >&dump.out regexp_diff match failure regexp "^.*: Assembler messages:$" line "Assembler messages:" regexp_diff match failure regexp "^.*:3: Warning:.*faddp.*$" line "FATAL: can't create a.out: Invalid bfd target" extra regexps in /root/binutils-2.15/gas/testsuite/gas/i386/float.l starting with "^.*:14: Warning:.*fsubp.*$" EOF from dump.out FAIL: i386 float I have no idea why this happens. xw _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On Mon, 18 May 2009, xorquewasp@... wrote:
> Hi. > > After a week off, another update: > > I've realised, too late, that I'm using a version of binutils > (2.19) that's incompatible with the system binutils (2.15). > Specifically, assembler code emitted by the native GNAT contains > .cfi_personality directives (and no doubt other things too) that > can't be processed by the system 'as'. > > I've got two choices now and would appreciate some advice on > which to take given that I want to produce a FreeBSD port: > > 1. Compile binutils-2.15. > > Unfortunately, compiling these as cross-binutils appear to be problematic: Hmm, if the system binutils is 2.15, then it should build as a cross. You can do a cross build of all FreeBSD - I think you just set TARGET="amd64" to build amd64 from a different arch. Part of this process should be to create a cross binutils toolset. > 2. Continue to use binutils-2.19. > > This would appear to require me to create a binutils-2.19 port > just for the GNAT compiler. Seems like it would be preferable > to use the system binutils rather than to take this route... Well, I used a newer binutils on sparc when I did the original port. Once I built the cross compiler and binutils toolset, I was done with it. After the native compiler is built using the cross tools, you should be able to rebuild the native compiler _again_ but this time with the system (amd64) binutils. -- DE _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On 2009-05-18 18:36:15, Daniel Eischen wrote:
> Hmm, if the system binutils is 2.15, then it should build > as a cross. You can do a cross build of all FreeBSD - I > think you just set TARGET="amd64" to build amd64 from > a different arch. Part of this process should be to > create a cross binutils toolset. Ok. Silly question - is it actually possible to build contrib/binutils (including TARGET=amd64) without building the whole tree? Trying the obvious: cd /usr/obj /usr/src/contrib/binutils/configure \ --target=x86_64-pc-freebsd7.2 \ --host=i386-pc-freebsd7.2 \ --build=i386-pc-freebsd7.2 \ --prefix=/cross/x86_64 .. Didn't work (didn't really expect it to). xw _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On 2009-05-18 18:36:15, Daniel Eischen wrote:
> Well, I used a newer binutils on sparc when I did the original > port. Once I built the cross compiler and binutils toolset, > I was done with it. After the native compiler is built using > the cross tools, you should be able to rebuild the native > compiler _again_ but this time with the system (amd64) > binutils. I probably should point out that I don't think this is the case anymore. GCC apparently detects what capabilities the currently selected binutils have so when the first native compiler has been compiled using the cross, it will emit code that can't be assembled using the system binutils (because it uses features from the new binutils that aren't supported by the older system ones). In other words, you can't rebuild the native compiler using the system binutils. If the worst comes to the worst, I can create a dependency on the devel/cross-binutils port. xw _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On Tue, 19 May 2009, xorquewasp@... wrote:
> On 2009-05-18 18:36:15, Daniel Eischen wrote: >> Well, I used a newer binutils on sparc when I did the original >> port. Once I built the cross compiler and binutils toolset, >> I was done with it. After the native compiler is built using >> the cross tools, you should be able to rebuild the native >> compiler _again_ but this time with the system (amd64) >> binutils. > > I probably should point out that I don't think this is the case anymore. > > GCC apparently detects what capabilities the currently selected binutils > have so when the first native compiler has been compiled using the > cross, it will emit code that can't be assembled using the system > binutils (because it uses features from the new binutils that aren't > supported by the older system ones). In other words, you can't rebuild the > native compiler using the system binutils. > > If the worst comes to the worst, I can create a dependency on the > devel/cross-binutils port. Even so, you shouldn't need a cross-binutils, only a native (amd64) binutils. Your port won't be a cross port, but a native amd64 port. The native amd64 GNAT will need a native binutils, not a cross binutils. The only thing you will have to make is a minimal bootstrap (native amd64) compiler. Of course you can create a cross port if you want to facilitate cross builds for ports that don't exist yet, but no one running amd64 will want to make a cross build when they can make a faster native build with less dependencies. -- DE _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On Tue, 19 May 2009, xorquewasp@... wrote:
> On 2009-05-18 18:36:15, Daniel Eischen wrote: >> Hmm, if the system binutils is 2.15, then it should build >> as a cross. You can do a cross build of all FreeBSD - I >> think you just set TARGET="amd64" to build amd64 from >> a different arch. Part of this process should be to >> create a cross binutils toolset. > > Ok. > > Silly question - is it actually possible to build contrib/binutils > (including TARGET=amd64) without building the whole tree? Trying > the obvious: > > cd /usr/obj > /usr/src/contrib/binutils/configure \ > --target=x86_64-pc-freebsd7.2 \ > --host=i386-pc-freebsd7.2 \ > --build=i386-pc-freebsd7.2 \ > --prefix=/cross/x86_64 > > .. Didn't work (didn't really expect it to). I've not done a cross build before, but I'd look in src/Makefile.inc1 if you want to try to build it piecemeal (see the target for cross-tools). -- DE _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64On 2009-05-19 09:51:08, Daniel Eischen wrote:
> > Even so, you shouldn't need a cross-binutils, only a native > (amd64) binutils. Your port won't be a cross port, but a > native amd64 port. The native amd64 GNAT will need a native > binutils, not a cross binutils. The only thing you will have > to make is a minimal bootstrap (native amd64) compiler. > > Of course you can create a cross port if you want to facilitate > cross builds for ports that don't exist yet, but no one running > amd64 will want to make a cross build when they can make a > faster native build with less dependencies. 'lo, Sorry, I should have been a bit clearer there. I mean if in the very worst case, I can't get by with the system binutils, I can create a "native" set of recent binutils using the cross-binutils port: cd /usr/ports/devel/cross-binutils make TGTARCH=x86_64 TGTABI=freebsd7.2 install That way, the port can just depend on those and I won't have to create my own binutils port. Like I said, I'm hoping this won't happen. Current status is that I have a working native AMD64 GNAT using 2.19 binutils! $ gcc44 -v Using built-in specs. Target: x86_64-pc-freebsd7.2 Configured with: /usr/jails/i386/root/gcc-4.4.0/configure --build=x86_64-pc-freebsd7.2 --enable-languages=c,ada --disable-nls --with-system-zlib --with-libiconv-prefix=/usr/local --program-suffix=44 --bindir=/usr/local/bin/gcc44 --libdir=/usr/local/lib/gcc-4.4.0 --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc44 Thread model: posix gcc version 4.4.0 (GCC) Needless to say, I'm pretty pleased. xw _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64How's this all going?
I'm updating lang/gnat to gnat-2009 right now. In the GNAT sources, it has build instructions including how to build the cross - see below. -- DE -------------------------------------- -- BUILDING GNAT - EXAMPLE SEQUENCE -- -------------------------------------- Supposing you have one tarball for the GCC sources and one for the GNAT sources, here is a possible way to proceed: 0/ If not available on your system, build libgmp and libmpfr following build instructions from these packages. 1/ Create a root directory into which you'll later setup the source and build subdirectories: ~ $ mkdir GNAT ~ $ cd GNAT 2/ Setup an initial source tree from the GCC and the GNAT tarballs: ~/GNAT $ gzip -dc [...]/gcc-4.3*.tgz | tar xf - ~/GNAT $ mv gcc-4* src ~/GNAT $ cd src ~/GNAT/src $ gzip -dc [...]/gnat-xxx-src.tgz | tar xf - ~/GNAT/src $ mv gnat-xxx-src/src/ada gcc ~/GNAT/src $ patch -p0 < gnat-xxx-src/src/gcc-43.dif ~/GNAT/src $ touch gcc/cstamp-h.in 3/ Prepare and configure the build tree: ~/GNAT/src $ mkdir ../obj; cd ../obj ~/GNAT/obj $ ../src/configure --enable-languages="c,ada" --disable-libada ... [see the GCC documentation for other relevant configure options] 4/ Build the compiler, run time and tools: Note that the use of "GNU Make" is required by the GCC Makefiles. ~/GNAT/obj $ make bootstrap ~/GNAT/obj $ make -C gcc gnatlib gnattools If you are building a cross compiler, you will need to replace the above sequence by something similar to: ~/GNAT/obj $ make ~/GNAT/obj $ make -C gcc gnatlib cross-gnattools ada.all.cross 5/ Install the whole package: ~/GNAT/obj $ make install _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
|
|
Re: bootstrapping gnat GCC on amd64Status update:
http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00102.html I replied to the last email in the thread but haven't heard back yet. Presumably I'll be maintaining the FreeBSD x86_64 port. I'm about to start work on the FreeBSD port now. _______________________________________________ freebsd-hackers@... mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..." |
| Free embeddable forum powered by Nabble | Forum Help |