From Fedora Project Wiki
(→‎gdb: now builds from source)
(→‎gettext: explained the horrible hack needed for building gettext)
Line 109: Line 109:
Patched aarch64 support to config.sub and config.guess.  Added patch to gettext.spec.
Patched aarch64 support to config.sub and config.guess.  Added patch to gettext.spec.
   
   
Still FTBFS for now; it looks like an extraneous usage of gets() is the issue.
Repaired deprecated use of gets() in old versions of gnulib, added patch to spec file.
 
Everything compiles automatically just fine; the make install step fails.  The cause appears to be overly complex shell code in some of the Makefiles created by ./configure (in particular in gettext-tools/src and gettext-tools/man).  For reasons yet to be determined, these Makefiles will fail because portions of shell variables have been completely corrupted; in the gettext-tools/src case, a list of the executables to be installed in the install-binPROGRAMS step gets horribly mangled so it tries to install programs that of course do not exist ('omm', in one case, which I thought was kind of funny, because I was no longer calm since the name should have been 'excomm' :).  Because the Makefiles are in error, and not the Makefile.in or Makefile.am, these would have to be patched after running the configure step; this can be fixed in the recipe.d snippet for gettext but for now I have created Makefiles called Makefile.hacked in the directories mentioned above and do the make install step by hand.  So, if you want to rebuild gettext in stage2, let it do 'make', and let it get as far it can with 'make install'.  When it does fail, go into the stage2/builds/gettext directory and where ever there is a Makefile.hacked file, copy that to Makefile.  Then, cd to stage2/builds/gettext and run 'make install', which should now complete.  When it does, 'touch stage2/done/gettext' to let the stage2 build continue to the next step.


=== popt ===
=== popt ===

Revision as of 19:18, 20 November 2012

AArch64 Bootstrap Stage2 Notes

Here's what changed from f17 to get aarch64 to bootstrap (using the rootfs built in stage1) in build order as determined by dependencies in the make file fragments. Stage1 details are here.

A copy of the current state of the stage2 rootfs can be retrieved from:

$ git clone http://fedorapeople.org/groups/armv8/rootfs.git

This rootfs can be used directly as an NFS root mount point if you have access to either the ARM FAST model or the ARM Foundation model (see http://www.arm.com/fvp); details for doing so are in Using ARMv8 Bootstrap Root FS via NFS root. With some preparation, you can also turn this set of files into a rootfs disk image that can be used with the ARM Foundation model (see ARMv8 using Fedora17 Bootstrap Image and ARM Foundation Model).

NB: just as with stage1 ( AArch64 Bootstrap Stage1 Notes), the sources used can be found here:

http://fedorapeople.org/groups/armv8/SRPMs

Look in the subdirectories f17/changed (which should have been copied into SRPMlocal in your copy of the bootstrap directory), and in the subdirectory f17/unchanged (which should be copied into SRPMs in your bootstrap directory).

To work with the stage2 rootfs, follow the instructions pointed to above and boot a model and either an NFS root or a disk image. Once you have booted into the rootfs, however, continuing the stage2 build is pretty straightforward:

# cd /stage2
# ./stage2

You will be running in a BusyBox environment at that point, and you do have most basic commands, and basic job control.

cpio

Source: cpio-2.11-6.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Patched use of gnulib to remove deprecated use of gets(). Added patches to cpio.spec.

ncurses

Source: ncurses-5.9-4.20120204.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to ncurses.spec.

m4

Source: m4-1.4.16-3.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Patched use of gnulib to remove deprecated use of gets(). Added patches to m4.spec.

flex

Source: flex-2.5.35-14.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to flex.spec.

bison

Source: bison-2.5-3.fc17.aarch.src.rpm

Patched aarch64 support to config.sub and config.guess. Patched use of gnulib to remove deprecated use of gets(). Added patches to bison.spec.

readline

Source: readline-6.2-4.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to readline.spec.

texinfo

Source: texinfo-4.13a-16.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to texinfo.spec.

gdb

Source: gdb-7.5.0.20120926-25.fc17.aarch64.src.rpm

Started with 7.5 version of the source (from f18), since the upstream patch uses ptrace and as such it did not apply to the 7.4 version; several functions ended up rewritten or replaced so that in some cases the upstream patch was referring to code that did not exist in 7.4.

Further, the upstream patch was incomplete. While it got most parts, it made the assumption that the subdirectories bfd/, opcodes/, and include/ had all been updated to reflect the latest binutils for aarch64; this was not the case for f17. So, merged each of those directories with the binutils files (in the same directories) from stage1 in order to add support for aarch64 everywhere it was needed.

Patched aarch64 support into config.sub and config.guess. Added all of these patches to gdb.spec.

libtool

Source: libtool-2.4.2-3.1.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to libtool.spec.

gdbm

Source: gdbm-1.10-2.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to gdbm.spec.

db4

Source: db4-4.8.30-10.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to db4.spec.

perl

Source: perl-5.14.2-215.fc17.aarch64.src.rpm

Patched the definition of Perl_repeatcpy() in util.c so that the last argument was consistently defined; it had been type IV (which defaulted to 64-bit on aarch64) in the definition, but type I32 (32-bit) in the declaration. Added patch to perl.spec.

curl

Source: curl-7.24.0-5.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to curl.spec.

nspr

Source: nspr-4.9.2-1.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to nspr.spec.

Patched _linux.cfg and _linux.h in pr/include/md to add in the aarch64 architecture; cloned the definitions used from ia64, another LP64 platform. Added patch to nspr.spec.

pcre

Source: pcre-8.21-6.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to pcre.spec.

Changed the recipe.d make snippet so that documentation is not installed. When running make install, the command lines generated (e.g., when installing the HTML files or man pages) are quite long and will sometimes get cut in odd places causing the make to fail, but only for the documentation; everything else has built properly.

gettext

Source: gettext-0.18.1.1-14.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to gettext.spec.

Repaired deprecated use of gets() in old versions of gnulib, added patch to spec file.

Everything compiles automatically just fine; the make install step fails. The cause appears to be overly complex shell code in some of the Makefiles created by ./configure (in particular in gettext-tools/src and gettext-tools/man). For reasons yet to be determined, these Makefiles will fail because portions of shell variables have been completely corrupted; in the gettext-tools/src case, a list of the executables to be installed in the install-binPROGRAMS step gets horribly mangled so it tries to install programs that of course do not exist ('omm', in one case, which I thought was kind of funny, because I was no longer calm since the name should have been 'excomm' :). Because the Makefiles are in error, and not the Makefile.in or Makefile.am, these would have to be patched after running the configure step; this can be fixed in the recipe.d snippet for gettext but for now I have created Makefiles called Makefile.hacked in the directories mentioned above and do the make install step by hand. So, if you want to rebuild gettext in stage2, let it do 'make', and let it get as far it can with 'make install'. When it does fail, go into the stage2/builds/gettext directory and where ever there is a Makefile.hacked file, copy that to Makefile. Then, cd to stage2/builds/gettext and run 'make install', which should now complete. When it does, 'touch stage2/done/gettext' to let the stage2 build continue to the next step.

popt

Source: popt-1.13-10.fc17.aarch64.src.rpm

Patched aarch64 support to config.sub and config.guess. Added patch to popt.spec.

This needs gettext to complete before it compiles. State unknown right now.

chkconfig

This requires gettext and popt to be built first but did not have them as "#requires" in the recipe.d file; added them.