NetBSD-Bugs archive

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

toolchain/52142: mips64 soft-float problems



>Number:         52142
>Category:       toolchain
>Synopsis:       mips64 soft-float problems
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 06 15:00:00 +0000 2017
>Originator:     John D. Baker
>Release:        NetBSD/evbmips mips64el 7.99.67, pkgsrc-2017Q1
>Organization:
>Environment:
NetBSD chalk.technoskunk.fur 7.99.67 NetBSD 7.99.67 (YEELOONG) #44: Mon Apr  3 08:19:03 CDT 2017  sysop%x3650.technoskunk.fur@localhost:/r1/build/current/obj/mips64el/sys/arch/evbmips/compile/YEELOONG evbmips

>Description:
As noted in threads here:

  http://mail-index.netbsd.org/port-evbmips/2017/04/04/msg000357.html
  http://mail-index.netbsd.org/port-evbmips/2017/04/05/msg000361.html

there is a problem with the "soft-float" choices between GCC and the
assembler.  Notably, attempting to build "pkgtools/cwrappers" (the
first dependency for building anything else) fails with:

[...]
===> Building for cwrappers-20170112
--- .gdbinit ---
--- alloc.o ---
--- .gdbinit ---
rm -f .gdbinit
touch .gdbinit
--- alloc.o ---
#   compile  cwrappers-20170112/alloc.o
gcc -O2 -fPIE  -msoft-float    -std=gnu99    -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare  -Wsystem-headers   -Wno-traditional   -Wa,--fatal-warnings  -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wformat=2  -Wno-format-zero-length  -Werror  -Wa,--fatal-warnings -DHAVE_NBCOMPAT_H=1 -I/d0/build/pkgsrc/pkgtools/cwrappers/work/libnbcompat  -c    alloc.c
--- cleanup-cc.o ---
#   compile  cwrappers-20170112/cleanup-cc.o
gcc -O2 -fPIE  -msoft-float    -std=gnu99    -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare  -Wsystem-headers   -Wno-traditional   -Wa,--fatal-warnings  -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wformat=2  -Wno-format-zero-length  -Werror  -Wa,--fatal-warnings -DHAVE_NBCOMPAT_H=1 -I/d0/build/pkgsrc/pkgtools/cwrappers/work/libnbcompat  -c    cleanup-cc.c
--- alloc.o ---
/tmp/ccTB8LJ8.s: Assembler messages:
/tmp/ccTB8LJ8.s: Warning: .gnu_attribute 4,3 requires `softfloat'
/tmp/ccTB8LJ8.s: Error: 1 warning, treating warnings as errors
*** [alloc.o] Error code 1

make: stopped in /d0/build/pkgsrc/pkgtools/cwrappers/work/cwrappers-20170112
--- cleanup-cc.o ---
/tmp/cceFha2y.s: Assembler messages:
/tmp/cceFha2y.s: Warning: .gnu_attribute 4,3 requires `softfloat'
/tmp/cceFha2y.s: Error: 1 warning, treating warnings as errors
*** [cleanup-cc.o] Error code 1

make: stopped in /d0/build/pkgsrc/pkgtools/cwrappers/work/cwrappers-20170112
2 errors

make: stopped in /d0/build/pkgsrc/pkgtools/cwrappers/work/cwrappers-20170112
*** Error code 2

Stop.
make[1]: stopped in /x/pkgsrc/pkgtools/cwrappers
*** Error code 1

Stop.
make: stopped in /x/pkgsrc/pkgtools/cwrappers


Applying the workaround noted in the "Fix" section below, but
restricting it to "pkgtools/cwrappers" only, satisfies the build.

Subsequent builds of other packages also report similar warnings
from the assembler, but are not deemed fatal.

Unfortunately, this breaks "devel/libtool-base" as the 'libtool'
script and supporting binaries are used to build other packages.
For example, attempting to build "security/sudo" fails with:

[...]
===> Building for sudo-1.8.17p1
for d in lib/util  plugins/group_file plugins/sudoers  plugins/system_group src include doc examples; do  (cd $d && exec /usr/bin/make all) && continue;  exit $?;  done
/bin/sh ../../libtool --tag=disable-static --mode=compile gcc -c -o event.lo -I../../include -I../.. -I. -I../.. -D_PATH_SUDO_CONF=\"/usr/pkg/etc/sudo.conf\" -I/usr/include -D_FORTIFY_SOURCE=2 -O2 -ggdb -D_OPENBSD_SOURCE=1 -pthread -I/usr/include   ./event.c
libtool: compile: Waiting for event.o.lock to be removed
libtool: compile: Waiting for event.o.lock to be removed
[...]

Rebuilding "devel/libtool-base" with the workaround in the "Fix"
section below allows it to function properly and builds of additional
'libtool'-using packages will succeed.

Unfortunately, "security/sudo" does not like having the workaround
applied to it and if built with it, the resulting 'sudo' binary will
fail with "Memory fault" immediately.

As shown in the "Fix" section, the workaround should exclude
"security/sudo".  It is not yet known if anything else should be
excluded.
>How-To-Repeat:
Attempt to build "pkgtools/cwrappers" on a mips64 (mips32?) platform.
See first failure as noted above.

Apply workaround below to "cwrappers" only and install
"devel/libtool-base" then attempt to build any package which uses
'libtool'.  See second failure noted above.

Apply workaround globally, rebuild any prior packages and then install
"security/sudo".  The resulting 'sudo' binary will fail with
"Memory fault".

Finally, as shown below, apply the workaround to all packages except
"security/sudo" and rebuild "security/sudo".  The resulting 'sudo'
binary will now work.
>Fix:
Workaround:

Add the following to "mk.conf":

.if "${PKGPATH}" != "security/sudo"
  CFLAGS+=	-Wa,-msoft-float
  CXXFLAGS+=	-Wa,-msoft-float
.endif



Home | Main Index | Thread Index | Old Index