View previous topic :: View next topic |
Author |
Message |
De-Javu n00b
Joined: 30 Mar 2009 Posts: 24 Location: USA
|
Posted: Mon Nov 16, 2015 11:13 pm Post subject: Stuck on building hardened 4.2.6-r3 w/ PaX & grsec |
|
|
I am trying to build hardened kernel, but keeps erroring out early on in make.
I can build a non hardened kernel perfectly fine.
Not sure what to do here...
Trying to make after make menuconfig results in this.
Code: | livecd linux-4.2.6-hardened-r3 # make
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CHK include/generated/bounds.h
CHK include/generated/timeconst.h
CC arch/powerpc/kernel/asm-offsets.s
In file included from include/linux/spinlock.h:87:0,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from arch/powerpc/kernel/asm-offsets.c:17:
./arch/powerpc/include/asm/spinlock.h: In function ‘__arch_read_trylock’:
./arch/powerpc/include/asm/spinlock.h:226:2: error: expected ‘:’ or ‘)’ before ‘_ASM_EXTABLE’
_ASM_EXTABLE(2b,4b)
^
./arch/powerpc/include/asm/spinlock.h:226:15: error: invalid suffix "b" on integer constant
_ASM_EXTABLE(2b,4b)
^
./arch/powerpc/include/asm/spinlock.h:226:18: error: invalid suffix "b" on integer constant
_ASM_EXTABLE(2b,4b)
^
./arch/powerpc/include/asm/spinlock.h: In function ‘arch_read_unlock’:
./arch/powerpc/include/asm/spinlock.h:323:2: error: expected ‘:’ or ‘)’ before ‘_ASM_EXTABLE’
_ASM_EXTABLE(2b, 4b)
^
./arch/powerpc/include/asm/spinlock.h:323:15: error: invalid suffix "b" on integer constant
^ [0/1975]
./arch/powerpc/include/asm/spinlock.h:323:15: error: invalid suffix "b" on integer constant
_ASM_EXTABLE(2b, 4b)
^
./arch/powerpc/include/asm/spinlock.h:323:19: error: invalid suffix "b" on integer constant
_ASM_EXTABLE(2b, 4b)
^
./arch/powerpc/include/asm/spinlock.h:300:7: warning: unused variable ‘tmp’ [-Wunused-variable]
long tmp;
^
In file included from include/linux/atomic.h:4:0,
from include/linux/spinlock.h:416,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from arch/powerpc/kernel/asm-offsets.c:17:
./arch/powerpc/include/asm/atomic.h: At top level:
./arch/powerpc/include/asm/atomic.h:16:1: error: expected identifier or ‘(’ before string constant
" .section __ex_table,\"a\"\n" \
^
./arch/powerpc/include/asm/atomic.h:58:2: note: in expansion of macro ‘_ASM_EXTABLE’
_ASM_EXTABLE(2b, 4b)
^
In file included from include/linux/atomic.h:127:0,
from include/linux/spinlock.h:416,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from arch/powerpc/kernel/asm-offsets.c:17:
include/asm-generic/atomic-long.h: In function ‘atomic_long_inc’:
include/asm-generic/atomic-long.h:264:2: error: implicit declaration of function ‘atomic_add’ [-Werror=implicit-function-declaration]
atomic_inc(v);
^
cc1: some warnings being treated as errors
Kbuild:80: recipe for target 'arch/powerpc/kernel/asm-offsets.s' failed
make[1]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1
Makefile:1066: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
livecd linux-4.2.6-hardened-r3 #
|
Tried to install kbuild but that didn't work either.
Code: | * Messages for package dev-util/kbuild-9999:
* ERROR: dev-util/kbuild-9999::gentoo failed (compile phase):
* bootstrap failed
*
* Call stack:
* ebuild.sh, line 93: Called src_compile
* environment, line 2631: Called die
* The specific snippet of code:
* kBuild/env.sh --full make -f bootstrap.gmk AUTORECONF=true || die "bootstrap failed"
*
* If you need support, post the output of `emerge --info '=dev-util/kbuild-9999::gentoo'`,
* the complete build log and the output of `emerge -pqv '=dev-util/kbuild-9999::gentoo'`.
* The complete build log is located at '/var/tmp/portage/dev-util/kbuild-9999/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-util/kbuild-9999/temp/environment'.
* Working directory: '/var/tmp/portage/dev-util/kbuild-9999/work'
* S: '/var/tmp/portage/dev-util/kbuild-9999/work/' |
I am following the handbook directly, but activated a few more PaX functions, so maybe that's it? Any help would be greatly appreciated.
P.S. this is a ppc32 machine if that makes a difference. |
|
Back to top |
|
|
De-Javu n00b
Joined: 30 Mar 2009 Posts: 24 Location: USA
|
Posted: Tue Nov 17, 2015 3:54 pm Post subject: |
|
|
reinstalled hardened-sources and even tried with genkernel... still nothing! is the ppc kernel broken or am i doing something wrong?
Code: |
livecd linux-4.2.6-hardened-r3 # genkernel --kerneldir="/usr/src/linux-4.2.6-hardened-r3/" all
* Gentoo Linux Genkernel; Version 3.4.49.2
* Running with options: --kerneldir=/usr/src/linux-4.2.6-hardened-r3/ all
* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/ppc/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/ppc/modules_load ..
* Linux Kernel 4.2.6-hardened-r3 for ppc...
* .. with config file /usr/share/genkernel/arch/ppc/kernel-config
mount: special device /dev/BOOT does not exist
* WARNING: Failed to mount /boot!
* kernel: Using config from /usr/share/genkernel/arch/ppc/kernel-config
* Previous config backed up to .config--2015-11-17--10-41-21.bak
* kernel: >> Running mrproper... [160/1887]
* >> Running oldconfig...
* kernel: >> Cleaning...
* >> Compiling 4.2.6-hardened-r3 vmlinux...
* ERROR: Failed to compile the "vmlinux" target...
*
* -- Grepping log... --
*
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/ppc/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/ppc/modules_load ..
*
* Linux Kernel 4.2.6-hardened-r3 for ppc...
* .. with config file /usr/share/genkernel/arch/ppc/kernel-config
* WARNING: Failed to mount /boot!
*--
* SHIPPED scripts/kconfig/zconf.lex.c
* SHIPPED scripts/kconfig/zconf.hash.c
* HOSTCC scripts/kconfig/zconf.tab.o
* HOSTLD scripts/kconfig/conf
*scripts/kconfig/conf --oldconfig Kconfig
*.config:269:warning: symbol value 'm' invalid for PCCARD_NONSTATIC
*.config:1120:warning: symbol value 'm' invalid for ISDN
*.config:1855:warning: override: reassigning to symbol LOGITECH_FF
*.config:1860:warning: override: reassigning to symbol PANTHERLORD_FF
*.config:1865:warning: override: reassigning to symbol THRUSTMASTER_FF
*.config:1866:warning: override: reassigning to symbol ZEROPLUS_FF
*.config:1867:warning: override: reassigning to symbol USB_SUPPORT
*.config:1868:warning: override: reassigning to symbol USB_ARCH_HAS_HCD
*.config:1872:warning: override: reassigning to symbol USB
*--
*
* Bus options
*
*Support for ISA-bus hardware (ISA) [N/y/?] n
*PCI Express Port Bus support (PCIEPORTBUS) [Y/n/?] y
* Root Port Advanced Error Reporting support (PCIEAER) [Y/n/?] y
* PCI Express ECRC settings control (PCIE_ECRC) [N/y/?] (NEW)
* PCIe AER error injector support (PCIEAER_INJECT) [N/m/y/?] (NEW) [123/1887]
*--
*SCSI OnStream SC-x0 tape support (CHR_DEV_OSST) [M/n/y/?] m
*SCSI CDROM support (BLK_DEV_SR) [Y/n/m/?] y
* Enable vendor-specific extensions (for SCSI CDROM) (BLK_DEV_SR_VENDOR) [Y/n/?] y
*SCSI generic support (CHR_DEV_SG) [M/n/y/?] m
*SCSI media changer support (CHR_DEV_SCH) [M/n/y/?] m
*Verbose SCSI error reporting (kernel size +=75K) (SCSI_CONSTANTS) [N/y/?] n
*--
*OSD-Initiator library (SCSI_OSD_INITIATOR) [N/m/y/?] (NEW)
*
* Serial ATA and Parallel ATA drivers (libata)
*
*Serial ATA and Parallel ATA drivers (libata) (ATA) [M/n/y/?] m
* Verbose ATA error reporting (ATA_VERBOSE_ERROR) [Y/n/?] (NEW)
*--
* IP-over-InfiniBand debugging (INFINIBAND_IPOIB_DEBUG) [Y/?] y
* IP-over-InfiniBand data path debugging (INFINIBAND_IPOIB_DEBUG_DATA) [N/y/?] n
* InfiniBand SCSI RDMA Protocol (INFINIBAND_SRP) [M/n/?] m
* iSCSI Extensions for RDMA (iSER) (INFINIBAND_ISER) [M/n/?] m
*
* EDAC (Error Detection And Correction) reporting
*
*EDAC (Error Detection And Correction) reporting (EDAC) [N/y/?] n
*--
* JFS statistics (JFS_STATISTICS) [N/y/?] n
*XFS filesystem support (XFS_FS) [Y/n/m/?] y
* XFS Quota support (XFS_QUOTA) [Y/n/?] y
* XFS POSIX ACL support (XFS_POSIX_ACL) [Y/n/?] y
* XFS Realtime subvolume support (XFS_RT) [Y/n/?] y
* XFS Verbose Warnings (XFS_WARN) [N/y/?] (NEW)
*--
*Dnotify support (DNOTIFY) [Y/n/?] y
*Inotify support for userspace (INOTIFY_USER) [Y/n/?] y
*Filesystem wide access notification (FANOTIFY) [N/y/?] (NEW)
*Quota support (QUOTA) [Y/n/?] y
*Report quota messages through netlink interface (QUOTA_NETLINK_INTERFACE) [N/y/?] (NEW)
*Print quota warnings to console (OBSOLETE) (PRINT_QUOTA_WARNING) [Y/n/?] (NEW)
*--
*Memtest (MEMTEST) [N/y/?] (NEW)
*
* Sample kernel code
*
*Sample kernel code (SAMPLES) [N/y/?] (NEW)
*Don't build arch/powerpc code with -Werror (PPC_DISABLE_WERROR) [N/y/?] (NEW)
*--
* CC arch/powerpc/platforms/chrp/time.o
* CC arch/powerpc/kernel/module.o
* CC arch/powerpc/platforms/chrp/pegasos_eth.o
* CC arch/powerpc/kernel/module_32.o
*arch/powerpc/kernel/module_32.c: In function ‘module_frob_arch_sections’:
*arch/powerpc/kernel/module_32.c:161:3: error: too many arguments for format [-Werror=format-extra-args]
* pr_err("Module $s doesn't contain .plt or .init.plt sections.\n", me->name);
* ^
*cc1: all warnings being treated as errors
*scripts/Makefile.build:258: recipe for target 'arch/powerpc/kernel/module_32.o' failed
*make[1]: *** [arch/powerpc/kernel/module_32.o] Error 1
*Makefile:1021: recipe for target 'arch/powerpc/kernel' failed
*make: *** [arch/powerpc/kernel] Error 2
*--
* Running with options: --kerneldir=/usr/src/linux-4.2.6-hardened-r3/ all
* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/ppc/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/ppc/modules_load ..
*
* ERROR: Failed to compile the "vmlinux" target...
*
* -- End log... --
*
* Please consult /var/log/genkernel.log for more information and any
* errors that were reported above.
*
* Report any genkernel bugs to bugs.gentoo.org and
* assign your bug to genkernel@gentoo.org. Please include
* as much information as you can in your bug report; attaching
* /var/log/genkernel.log so that your issue can be dealt with effectively.
*
* Please do *not* report compilation failures as genkernel bugs!
* |
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54744 Location: 56N 3W
|
Posted: Tue Nov 17, 2015 7:13 pm Post subject: |
|
|
Moved from Installing Gentoo to Gentoo on PPC.
Probably a better fit here.
In your first post, Code: | ./arch/powerpc/include/asm/spinlock.h: In function ‘__arch_read_trylock’:
./arch/powerpc/include/asm/spinlock.h:226:2: error: expected ‘:’ or ‘)’ before ‘_ASM_EXTABLE’
_ASM_EXTABLE(2b,4b) | appears to be an error is the source code.
In your second post Code: | *cc1: all warnings being treated as errors | is a bad thing.
I don't think I have ever seen a kernel build with no warnings. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
De-Javu n00b
Joined: 30 Mar 2009 Posts: 24 Location: USA
|
Posted: Tue Nov 17, 2015 7:39 pm Post subject: |
|
|
That's what I thought, that it must be an error in the source code...
I definitely didn't see any option to treat all warnings as errors, which confused me, as that error still showed up even after I deleted .config and started over to be sure it wasn't a bad option breaking things.
I have built 4.0.9 non-hardened successfully again, so at least my machine is capable of compiling some kernel... Even 4.0.9 hardened would be nice but there is no hardened stage3 available for ppc. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54744 Location: 56N 3W
|
Posted: Tue Nov 17, 2015 8:22 pm Post subject: |
|
|
mckickflip,
Ask in #gentoo-hardened on freenode.net _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|