Bug 199431 - [arm] multimedia/cuse4bsd-kmod using unsupported CPU flags on ARM
Summary: [arm] multimedia/cuse4bsd-kmod using unsupported CPU flags on ARM
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Some People
Assignee: Sean Bruno
URL: http://chips.ysv.freebsd.org/data/11a...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-13 23:00 UTC by Sean Bruno
Modified: 2015-04-14 19:27 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (hselasky)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Bruno freebsd_committer freebsd_triage 2015-04-13 23:00:14 UTC
It looks like the build bits of cuse4bsd need to be tightened up a bit as its trying to use x86 specific clfags on non-x86 builds:

/nxb-bin/usr/bin/cc -O2 -pipe -fno-strict-aliasing  -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -Wno-error-pointer-sign -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-unknown-pragmas  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -Wno-error-pointer-sign  -mno-aes -mno-avx  -std=iso9899:1999 -c cuse4bsd_kmod.c -o cuse4bsd_kmod.o
cc: error: argument unused during compilation: '-mno-red-zone' [-Werror,-Wunused-command-line-argument]
cc: error: argument unused during compilation: '-mno-mmx' [-Werror,-Wunused-command-line-argument]
cc: error: argument unused during compilation: '-mno-sse' [-Werror,-Wunused-command-line-argument]
cc: error: argument unused during compilation: '-mno-aes' [-Werror,-Wunused-command-line-argument]
cc: error: argument unused during compilation: '-mno-avx' [-Werror,-Wunused-command-line-argument]
*** Error code 1
Comment 1 Sean Bruno freebsd_committer freebsd_triage 2015-04-13 23:09:15 UTC
It looks like I need to ensure that MACHINE/MACHINE_ARCH are set when building a kmod from ports, else the bsd mk scripts will pickup MACHINE from the host.

root@11armv6hf-default:/wrkdirs/usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.36 # env |grep MACHINE
MACHINE=arm
MACHINE_ARCH=armv6hf
root@11armv6hf-default:/wrkdirs/usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.36 # make clean ; make
make -f /wrkdirs/usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.36/Makefile.lib clean
rm -f cuse4bsd.3.gz cuse4bsd.3.cat.gz
rm -f a.out cuse4bsd_lib.o cuse4bsd_lib.o.tmp 
rm -f cuse4bsd_lib.So cuse4bsd_lib.so cuse4bsd_lib.So.tmp
rm -f libcuse4bsd.so
rm -f libcuse4bsd.a libcuse4bsd.so.1
make -f /wrkdirs/usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.36/Makefile.kmod clean cleandepend
rm -f export_syms machine cuse4bsd.ko cuse4bsd.kld cuse4bsd_kmod.o opt_compat.h bus_if.h device_if.h vnode_if.h vnode_if_newproto.h vnode_if_typedef.h
rm -f machine
rm -f .depend GPATH GRTAGS GSYMS GTAGS
make -f /wrkdirs/usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.36/Makefile.lib  " DESTDIR=" " KMODNAME=cuse4bsd" " KMODDIR=/boot/modules" " LIBDIR=/usr/local/lib" " INCLUDEDIR=/usr/local/include" " MANDIR=/usr/local/man/man" all
Warning: Object directory not changed from original /wrkdirs/usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.36
/nxb-bin/usr/bin/cc  -O -pipe   -D_GNU_SOURCE -std=gnu99   -Qunused-arguments -c cuse4bsd_lib.c -o cuse4bsd_lib.o
building static cuse4bsd library
/nxb-bin/usr/bin/ranlib -D libcuse4bsd.a
/nxb-bin/usr/bin/cc -fpic -DPIC  -O -pipe   -D_GNU_SOURCE -std=gnu99   -Qunused-arguments -c cuse4bsd_lib.c -o cuse4bsd_lib.So
building shared library libcuse4bsd.so.1
/nxb-bin/usr/bin/cc   -shared -Wl,-x -Wl,--fatal-warnings -Wl,--warn-shared-textrel  -o libcuse4bsd.so.1 -Wl,-soname,libcuse4bsd.so.1  `NM='/nxb-bin/usr/bin/nm' lorder cuse4bsd_lib.So | tsort -q`  -lpthread
gzip -cn cuse4bsd.3 > cuse4bsd.3.gz
make -f /wrkdirs/usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.36/Makefile.kmod  " DESTDIR=" " KMODNAME=cuse4bsd" " KMODDIR=/boot/modules" " LIBDIR=/usr/local/lib" " INCLUDEDIR=/usr/local/include" " MANDIR=/usr/local/man/man" all
Warning: Object directory not changed from original /wrkdirs/usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.36
machine -> /usr/src/sys/arm/include
/nxb-bin/usr/bin/awk -f /sys/tools/makeobjops.awk /sys/kern/device_if.m -h
/nxb-bin/usr/bin/awk -f /sys/tools/makeobjops.awk /sys/kern/bus_if.m -h
/nxb-bin/usr/bin/awk -f /sys/tools/vnode_if.awk /sys/kern/vnode_if.src -p
/nxb-bin/usr/bin/awk -f /sys/tools/vnode_if.awk /sys/kern/vnode_if.src -q
/nxb-bin/usr/bin/awk -f /sys/tools/vnode_if.awk /sys/kern/vnode_if.src -h
:> opt_compat.h
/nxb-bin/usr/bin/cc -O -pipe  -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/sys -I/sys/contrib/altq -fno-common  -funwind-tables  -ffreestanding -fwrapv -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -Wno-error-pointer-sign -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-unknown-pragmas  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -Wno-error-pointer-sign  -mllvm -arm-use-movt=0 -mfpu=none  -std=iso9899:1999 -c cuse4bsd_kmod.c -o cuse4bsd_kmod.o
/nxb-bin/usr/bin/ld -d -warn-common -r -d -o cuse4bsd.kld cuse4bsd_kmod.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk cuse4bsd.kld  export_syms | xargs -J% /nxb-bin/usr/bin/objcopy % cuse4bsd.kld
/nxb-bin/usr/bin/ld -Bshareable -d -warn-common -o cuse4bsd.ko cuse4bsd.kld
/nxb-bin/usr/bin/objcopy --strip-debug cuse4bsd.ko
Comment 2 Sean Bruno freebsd_committer freebsd_triage 2015-04-14 04:48:16 UTC
This is being resolved in poudriere by setting MACHINE/MACHINE_ARCH in make.conf in the build jail.

https://github.com/freebsd/poudriere/compare/9195a462aaef59e158dad5f24a8fbad8cfc4e688...b11b3be
Comment 3 Warner Losh freebsd_committer freebsd_triage 2015-04-14 19:27:46 UTC
Setting MACHINE and MACHINE_ARCH are the right thing to do. They are normally set during a buildkernel so are picked up by the modules.