pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bootstrapping on HP-UX



On Fri, Jun 18, 2021 at 05:15:58AM +0000, nia wrote:
On Thu, Jun 17, 2021 at 06:06:17PM +0200, Lehel Bernadt wrote:
The command line is "./bootstrap --abi 64 --prefer-pkgsrc yes" and after
starting to build gcc2 for some reason, it fails here:

Attempting to build gcc2 is pkgsrc's way of telling you it couldn't
find a toolchain.

According to bootstrap/README.HPUX, using a prebuilt GCC binary
distribution is the way to go. These are available here:

http://ftp.netbsd.org/pub/pkgsrc/misc/tnn/gcc-4.2.3-hpux-11.11-32.tar.gz

I had read this file, and also https://wiki.netbsd.org/pkgsrc/how_to_use_pkgsrc_on_hp-ux/ and neither did explicitly warn against using the HP C compiler for bootstrapping. Anyway, I downloaded the above archive, but this is a PA-RISC toolchain, and it fails on Itanium:
==========================================
configure:2788: checking whether the C compiler works
configure:2810: /usr/local/gcc4/bin/gcc    conftest.c  >&5
ld: Mismatched ABI (not an ELF file) for -lgcc, found /usr/local/gcc4/lib/gcc/hppa2.0w-hp-hpux11.11/4.2.3/libgcc.a
Fatal error.
collect2: ld returned 1 exit status
==========================================

However, I noticed the --compiler option being used on the wiki page, so I tried again with the native compiler, adding "--compiler hp" to the boostrap command line.

Now it did not attempt to build gcc2, but it failed here:
==========================================
cc -O2  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wreturn-type -Wcast-qual -Wpointer-arith -Wwrite-strings -Wswitch -Wshadow  -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -DDEF_UMASK=0022 -I/opt/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/bzip2 -I/opt/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/zlib -I/opt/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libarchive/libarchive -I/opt/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libfetch -I/opt/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work -DHAVE_NBCOMPAT_H=1 -I/opt/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libnbcompat -I. -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -DINET6 -DFTP_COMBINE_CWDS -c common.c
cc: error 1914: bad form for `-W' option
*** Error code 1

Stop.
bmake: stopped in /opt/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libfetch
*** Error code 1
==========================================

I found these -W options in pkgtools/bootstrap-mk-files/files/bsd.sys.mk, so as a quick workaround I removed the lines from the top of the file - this should be fixed so that they are not used when the compiler is not gcc.

After this the bootstrap finished successfully!
I will see if a recent gcc can be built starting from here.

Regards,
Lehel

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index