Current-Users archive

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

Re: Building PCC for "tools" is broken (missing symbol __USE)- PCC bug or NetBSD source tree error?



PCC is getting there...

I have applied the diff to the PCC source tree inside the NetBSD source. Although the source tree has been updated since Iain first imported pcc-20140706, the patch applied cleanly, minus one hunk that I for some reason don't think is a big deal :P:

cgram.y.rej
--- cgram.y:1.376    Wed Jul  2 17:31:41 2014
+++ cgram.y    Fri Jul 25 11:30:39 2014
@@ -1,4 +1,4 @@
-/*    $Id: cgram.y,v 1.376 2014/07/02 15:31:41 ragge Exp $    */
+/*    $Id: cgram.y,v 1.377 2014/07/25 09:30:39 ragge Exp $    */

/*
 * Copyright (c) 2003 Anders Magnusson (ragge%ludd.luth.se@localhost).

vs cgram.y, lines 1 and 2:
/*    Id: cgram.y,v 1.376 2014/07/02 15:31:41 ragge Exp     */
/*    $NetBSD: cgram.y,v 1.1.1.7 2014/07/24 19:23:21 plunky Exp $    */

It would be rather odd if a comments patch caused compilation to fail XD.


As of applying this patch, regex.c in libiberty now compiles correctly (see 7/24/2014 at 10:15 PM EDT for the error re: register):
dependall ===> lib/../external/gpl3/binutils/lib/libbfd
dependall ===> lib/../external/gpl3/binutils/lib/libiberty
#   compile  libiberty/regex.o
/mnt/lfs/NetBSD-CVS/src/../tools/bin/i486--netbsdelf-pcc -O2 -std=gnu99 -Werror -Os -Wno-error=uninitialized -Wno-error=maybe-uninitialized --sysroot=/mnt/lfs/NetBSD-CVS/src/../destdir/i386-pb -DHAVE_CONFIG_H -I/mnt/lfs/NetBSD-CVS/src/external/gpl3/binutils/lib/libiberty/arch/i386 -I/mnt/lfs/NetBSD-CVS/src/external/gpl3/binutils/dist/include -c -Wno-stack-protector /mnt/lfs/NetBSD-CVS/src/external/gpl3/binutils/dist/libiberty/regex.c -o regex.o
/mnt/lfs/NetBSD-CVS/src/../tools/bin/i486--netbsdelf-objcopy -x   regex.o
#     build  libiberty/libiberty.a
rm -f libiberty.a
/mnt/lfs/NetBSD-CVS/src/../tools/bin/i486--netbsdelf-ar crsD libiberty.a `NM=/mnt/lfs/NetBSD-CVS/src/../tools/bin/i486--netbsdelf-nm NM=/mnt/lfs/NetBSD-CVS/src/../tools/bin/i486--netbsdelf-nm MKTEMP=/mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmktemp /mnt/lfs/NetBSD-CVS/src/../tools/bin/nblorder regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o mempcpy.o mkstemps.o strverscmp.o | /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbtsort -q`
dependall ===> lib/../crypto/external/bsd/netpgp/libmj
install-../crypto/external/bsd/netpgp/libmj ===> lib (with: install-../crypto/external/bsd/netpgp/lib/verify install-../external/bsd/elftoolchain/lib/libdwarf install-../external/mit/lua/lib install-libcurses install-libdm install-libedit install-libexecinfo install-libppath install-libperfuse install-libquota install-librefuse install-libisns install-librumpuser install-librumphijack install-libnpf install-../crypto/external/bsd/openssl/lib install-../external/bsd/file/lib install-../external/bsd/iscsi/lib install-../external/bsd/libarchive/lib install-../external/gpl2/lvm2/lib install-../external/gpl3/binutils/lib)
install ===> lib/../crypto/external/bsd/netpgp/lib/verify

Unfortunately there are now two errors- one compiling the kernel, and the other compiling userland... The error in the kernel happens at assym.d (Ignore the kernel name- it's a slightly modified GENERIC_TINY). I'm not sure what happened here, but it appears the preprocessor doesn't like being invoked with the following command line. The only single-period I see is "-I.", and that works when the preprocessor by calling it directly:
#    create  PB_KERNEL/assym.d
cat /mnt/lfs/NetBSD-CVS/src/sys/arch/i386/i386/genassym.cf | /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbgenassym -- CC=/mnt/lfs/NetBSD-CVS/src/../tools/bin/i486--netbsdelf-pcc /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmkdep -f assym.dep -- -msoft-float -mno-mmx -mno-sse -mno-avx -ffreestanding -fno-zero-initialized-in-bss -Os -Wno-error=uninitialized -Wno-error=maybe-uninitialized -fno-strict-aliasing -fno-common -std=gnu99 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreachable-code -Wno-pointer-sign -Wno-attributes -Wextra -Wno-unused-parameter -Wold-style-definition -Wno-sign-compare --sysroot=/mnt/lfs/NetBSD-CVS/src/../destdir/i386-pb -Di386 -I. -I/mnt/lfs/NetBSD-CVS/src/sys/../common/include -I/mnt/lfs/NetBSD-CVS/src/sys/arch -I/mnt/lfs/NetBSD-CVS/src/sys -nostdinc -DMAXUSERS=8 -D_KERNEL -D_KERNEL_OPT -std=gnu99 -I/mnt/lfs/NetBSD-CVS/src/sys/lib/libkern/../../../common/lib/libc/quad -I/mnt/lfs/NetBSD-CVS/src/sys/lib/libkern/../../../common/lib/libc/string -I/mnt/lfs/NetBSD-CVS/src/sys/lib/libkern/../../../common/lib/libc/arch/i386/string -I/mnt/lfs/NetBSD-CVS/src/sys/external/bsd/ipf /mnt/lfs/NetBSD-CVS/src/../tools/libexec/i486--netbsdelf-cpp: invalid option -- '.'
Usage: cpp [-Cdt] [-Dvar=val] [-Uvar] [-Ipath] [-Spath]
error: /mnt/lfs/NetBSD-CVS/src/../tools/libexec/i486--netbsdelf-cpp terminated
with status 1
nbmkdep: compile failed.

*** Failed target:  assym.d
*** Failed command: cat /mnt/lfs/NetBSD-CVS/src/sys/arch/i386/i386/genassym.cf | /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbgenassym -- CC=/mnt/lfs/NetBSD-CVS/src/../tools/bin/i486--netbsdelf-pcc /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmkdep-f assym.dep -- -msoft-float -mno-mmx -mno-sse -mno-avx -ffreestanding -fno-zero-initialized-in-bss -Os -Wno-error=uninitialized -Wno-error=maybe-uninitialized -fno-strict-aliasing -fno-common -std=gnu99 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreachable-code -Wno-pointer-sign -Wno-attributes -Wextra -Wno-unused-parameter -Wold-style-definition -Wno-sign-compare --sysroot=/mnt/lfs/NetBSD-CVS/src/../destdir/i386-pb -Di386 -I. -I/mnt/lfs/NetBSD-CVS/src/sys/../common/include -I/mnt/lfs/NetBSD-CVS/src/sys/arch -I/mnt/lfs/NetBSD-CVS/src/sys -nostdinc -DMAXUSERS=8 -D_KERNEL -D_KERNEL_OPT -std=gnu99 -I/mnt/lfs/NetBSD-CVS/src/sys/lib/libkern/../../../common/lib/libc/quad -I/mnt/lfs/NetBSD-CVS/src/sys/lib/libkern/../../../common/lib/libc/string -I/mnt/lfs/NetBSD-CVS/src/sys/lib/libkern/../../../common/lib/libc/arch/i386/string -I/mnt/lfs/NetBSD-CVS/src/sys/external/bsd/ipf
*** Error code 1

Stop.
nbmake: stopped in /mnt/lfs/NetBSD-CVS/objdir/i386-pb/sys/arch/i386/compile/PB_KERNEL

ERROR: Failed to make depend in "/mnt/lfs/NetBSD-CVS/src/../objdir/i386-pb/sys/arch/i386/compile/PB_KERNEL"
*** BUILD ABORTED ***
william@xubuntu-ltrain:~/Projects/NetBSD-CVS/src$


The error in userland happens at libatf-c++, complaining about a missing C++ compiler. It seems that groff is no longer the only C++ code in the source tree. Iain mentioned that UNSUPPORTED_COMPILER.pcc= can be set to skip tools that the compiler cannot build. Since pcc does not have complete C++ support, this is what I'll probably do (I have not tested this yet- I'm stopping at errors as I find them to notify the mailing list).

#    create  libatf-c++/application.d
CC=/mnt/lfs/NetBSD-CVS/src/../tools/bin/i486--netbsdelf-p++ /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmkdep -f ation.d.tmp -- --sysroot=/mnt/lfs/NetBSD-CVS/src/../destdir/i386-pb -DHAVE_CONFIG_H -DATF_ARCH=\"i386\" -DATF_BUILD_CC=\"/usr/bin/cc\" -DATF_BUILD_CFLAGS=\"\" -DATF_BUILD_CPP=\"/usr/bin/cpp\" -DATF_BUILD_CPPFLAGS=\"\" -DATF_BUILD_CXX=\"/usr/bin/c++\" -DATF_BUILD_CXXFLAGS=\"\" -DATF_CONFDIR=\"/etc/atf\" -DATF_INCLUDEDIR=\"/usr/include\" -DATF_LIBDIR=\"/usr/lib\" -DATF_LIBEXECDIR=\"/usr/libexec\" -DATF_MACHINE=\"i386\" -DATF_M4=\"/usr/bin/m4\" -DATF_PKGDATADIR=\"/usr/share/atf\" -DATF_SHELL=\"/bin/sh\" -DATF_WORKDIR=\"/tmp\" -I/mnt/lfs/NetBSD-CVS/src/external/bsd/atf -I/mnt/lfs/NetBSD-CVS/src/external/bsd/atf/lib/libatf-c -I/mnt/lfs/NetBSD-CVS/src/external/bsd/atf/dist /mnt/lfs/NetBSD-CVS/src/external/bsd/atf/dist/atf-c++/detail/application.cpp && mv application.d.tmp application.d nbmkdep: /mnt/lfs/NetBSD-CVS/src/../tools/bin/i486--netbsdelf-p++: not found: No such file or directory

*** Failed target:  application.d
*** Failed command: CC=/mnt/lfs/NetBSD-CVS/src/../tools/bin/i486--netbsdelf-p++ /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmkdep -f application.d.tmp -- --sysroot=/mnt/lfs/NetBSD-CVS/src/../destdir/i386-pb -DHAVE_CONFIG_H -DATF_ARCH=\"i386\" -DATF_BUILD_CC=\"/usr/bin/cc\" -DATF_BUILD_CFLAGS=\"\" -DATF_BUILD_CPP=\"/usr/bin/cpp\" -DATF_BUILD_CPPFLAGS=\"\" -DATF_BUILD_CXX=\"/usr/bin/c++\" -DATF_BUILD_CXXFLAGS=\"\" -DATF_CONFDIR=\"/etc/atf\" -DATF_INCLUDEDIR=\"/usr/include\" -DATF_LIBDIR=\"/usr/lib\" -DATF_LIBEXECDIR=\"/usr/libexec\" -DATF_MACHINE=\"i386\" -DATF_M4=\"/usr/bin/m4\" -DATF_PKGDATADIR=\"/usr/share/atf\" -DATF_SHELL=\"/bin/sh\" -DATF_WORKDIR=\"/tmp\" -I/mnt/lfs/NetBSD-CVS/src/external/bsd/atf -I/mnt/lfs/NetBSD-CVS/src/external/bsd/atf/lib/libatf-c -I/mnt/lfs/NetBSD-CVS/src/external/bsd/atf/dist /mnt/lfs/NetBSD-CVS/src/external/bsd/atf/dist/atf-c++/detail/application.cpp && mv application.d.tmp application.d
*** Error code 1

Stop.
nbmake[7]: stopped in /mnt/lfs/NetBSD-CVS/src/external/bsd/atf/lib/libatf-c++

*** Failed target:  dependall-libatf-c++
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="lib/../external/bsd/atf/lib/"; real="/mnt/lfs/NetBSD-CVS/src/external/bsd/atf/lib" ;; *) this="lib/../external/bsd/atf/lib/${dir}/"; real="/mnt/lfs/NetBSD-CVS/src/external/bsd/atf/lib/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget libatf-c++ dependall
*** Error code 1

Stop.
nbmake[6]: stopped in /mnt/lfs/NetBSD-CVS/src/external/bsd/atf/lib

*** Failed target:  dependall-../external/bsd/atf/lib
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="lib/"; real="/mnt/lfs/NetBSD-CVS/src/lib" ;; *) this="lib/${dir}/"; real="/mnt/lfs/NetBSD-CVS/src/lib/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget ../external/bsd/atf/lib dependall
*** Error code 1

Stop.
nbmake[5]: stopped in /mnt/lfs/NetBSD-CVS/src/lib

*** Failed target:  build_install
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="lib/"; real="/mnt/lfs/NetBSD-CVS/src/lib" ;; *) this="lib/${dir}/"; real="/mnt/lfs/NetBSD-CVS/src/lib/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget . dependall-npf dependall-../external/bsd/atf/lib dependall-libform dependall-libmenu dependall-libradius dependall-librump dependall-../crypto/external/bsd/heimdal/lib dependall-../crypto/external/bsd/openssh/lib dependall-../crypto/external/bsd/netpgp/lib dependall-../external/bsd/libevent/lib dependall-../external/bsd/fetch/lib dependall-../external/bsd/openldap/lib
*** Error code 1

Stop.
nbmake[4]: stopped in /mnt/lfs/NetBSD-CVS/src/lib

*** Failed target:  do-lib
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/mnt/lfs/NetBSD-CVS/src" ;; *) this="${dir}/"; real="/mnt/lfs/NetBSD-CVS/src/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget lib build_install
*** Error code 1

Stop.
nbmake[3]: stopped in /mnt/lfs/NetBSD-CVS/src

*** Failed target:  build
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/mnt/lfs/NetBSD-CVS/src" ;; *) this="${dir}/"; real="/mnt/lfs/NetBSD-CVS/src/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget . do-lib
*** Error code 1

Stop.
nbmake[2]: stopped in /mnt/lfs/NetBSD-CVS/src

*** Failed target:  distribution
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/mnt/lfs/NetBSD-CVS/src" ;; *) this="${dir}/"; real="/mnt/lfs/NetBSD-CVS/src/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget . build NOPOSTINSTALL=1
*** Error code 1

Stop.
nbmake[1]: stopped in /mnt/lfs/NetBSD-CVS/src

*** Failed target:  release
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/mnt/lfs/NetBSD-CVS/src" ;; *) this="${dir}/"; real="/mnt/lfs/NetBSD-CVS/src/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /mnt/lfs/NetBSD-CVS/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget . distribution
*** Error code 1

Stop.
nbmake: stopped in /mnt/lfs/NetBSD-CVS/src

ERROR: Failed to make release
*** BUILD ABORTED ***
william@xubuntu-ltrain:~/Projects/NetBSD-CVS/src$

In any case, it seems that pcc is getting closer to being able to compile the NetBSD source tree. Perhaps it'll be ready in time for 7 release at this rate (I'll file a problem report with the relevant patches if I can get a GENERIC i386 kernel to build). I'll be on standby ready to apply patches from the main PCC source tree if need be, and be I'll sure to send a diff of my PCC tree (which has patches from the main source tree applied) vs the one currently in NetBSD.


-----Original Message----- From: Anders Magnusson
Sent: Saturday, July 26, 2014 3:43 AM
To: William D. Jones
Cc: current-users%NetBSD.org@localhost
Subject: Re: Building PCC for "tools" is broken (missing symbol __USE)- PCC bug or NetBSD source tree error?

The commit messages are saved at marc.info, see
http://marc.info/?l=pcc-commit-list&m=140628065609751&w=2

To get a diff you can use cvs -d
:pserver:anonymous%pcc.ludd.ltu.se@localhost:/cvsroot rdiff -u -r1.376 -r1.377
pcc/cc/ccom/cgram.y

Should be directly applyable.

-- Ragge

Sincerely,

--
William D. Jones
Rowan University | ECE | 2012
Member IEEE
Member Tau Beta Pi
thor0505%comcast.net@localhost
Message sent using 'Windows Live Mail' client.

Home | Main Index | Thread Index | Old Index