Bug 204636 - make buildworld failed on Raspberry Pi 2 with error "instruction requires: armv6t2" when make.conf has CPUTYPE?=native
Summary: make buildworld failed on Raspberry Pi 2 with error "instruction requires: ar...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm Any
: --- Affects Many People
Assignee: Mark Linimon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-17 19:11 UTC by Hamza Sheikh
Modified: 2021-06-30 01:01 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hamza Sheikh 2015-11-17 19:11:38 UTC
On revision 290996, `make buildworld` failed with the following output.

crt1.s:66:2: error: instruction requires: armv6t2
        movw    r0, :lower16:environ
        ^
crt1.s:69:2: error: instruction requires: armv6t2
        movt    r0, :upper16:environ
        ^
crt1.s:80:2: error: instruction requires: armv6t2
        movw    r1, :lower16:__progname
        ^
crt1.s:81:2: error: instruction requires: armv6t2
        movt    r1, :upper16:__progname
        ^
crt1.s:106:2: error: instruction requires: armv6t2
        movw    r4, :lower16:_DYNAMIC
        ^
crt1.s:107:2: error: instruction requires: armv6t2
        movwne  r0, :lower16:__ps_strings
        ^
crt1.s:108:2: error: instruction requires: armv6t2
        movt    r4, :upper16:_DYNAMIC
        ^
crt1.s:109:2: error: instruction requires: armv6t2
        movtne  r0, :upper16:__ps_strings
        ^
crt1.s:123:2: error: instruction requires: armv6t2
        movw    r0, :lower16:finalizer
        ^
crt1.s:124:2: error: instruction requires: armv6t2
        movt    r0, :upper16:finalizer
        ^
crt1.s:126:2: error: instruction requires: armv6t2
        movw    r9, :lower16:__preinit_array_start
        ^
crt1.s:127:2: error: instruction requires: armv6t2
        movw    r0, :lower16:__preinit_array_end
        ^
crt1.s:129:2: error: instruction requires: armv6t2
        movt    r9, :upper16:__preinit_array_start
        ^
crt1.s:130:2: error: instruction requires: armv6t2
        movt    r0, :upper16:__preinit_array_end
        ^
crt1.s:153:2: error: instruction requires: armv6t2
        movw    r7, :lower16:__init_array_start
        ^
crt1.s:154:2: error: instruction requires: armv6t2
        movw    r0, :lower16:__init_array_end
        ^
crt1.s:155:2: error: instruction requires: armv6t2
        movt    r7, :upper16:__init_array_start
        ^
crt1.s:156:2: error: instruction requires: armv6t2
        movt    r0, :upper16:__init_array_end
        ^
crt1.s:200:2: error: instruction requires: armv6t2
        movw    r4, :lower16:__fini_array_start
        ^
crt1.s:201:2: error: instruction requires: armv6t2
        movw    r0, :lower16:__fini_array_end
        ^
crt1.s:202:2: error: instruction requires: armv6t2
        movt    r4, :upper16:__fini_array_start
        ^
crt1.s:203:2: error: instruction requires: armv6t2
        movt    r0, :upper16:__fini_array_end
        ^
*** Error code 1

Stop.
make[5]: stopped in /usr/src/lib/csu/arm
*** Error code 1

Stop.
make[4]: stopped in /usr/src/lib/csu
*** Error code 1

Stop.
make[3]: stopped in /usr/src
*** Error code 1
*** Error code 1

Stop.
make[2]: stopped in /usr/src
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src





This may be related to LLVM bug https://llvm.org/bugs/show_bug.cgi?id=12926

# which -a clang
/usr/bin/clang
# clang --version
FreeBSD clang version 3.6.1 (tags/RELEASE_361/final 237755) 20150525
Target: armv6--freebsd11.0-gnueabi
Thread model: posix
Comment 1 Hamza Sheikh 2015-11-27 18:53:58 UTC
$ cat /etc/make.conf
CC=clang
CXX=clang++
CPP=clang-cpp
WRKDIRPREFIX=/tmp
CPUTYPE?=native
WITH_PKGNG=yes
Comment 2 Hamza Sheikh 2015-11-29 18:20:52 UTC
Removed `CPUTYPE?=native` from /etc/make.conf and `make buildworld` completed successfully.

$ cat /etc/make.conf
CC=clang
CXX=clang++
CPP=clang-cpp
WRKDIRPREFIX=/tmp
WITH_PKGNG=yes
Comment 3 Hamza Sheikh 2015-12-02 03:57:00 UTC
Reopening bug based on mailing list post since it appears this is a real bug.

https://lists.freebsd.org/pipermail/freebsd-arm/2015-November/012713.html
Comment 4 Hamza Sheikh 2015-12-02 04:01:14 UTC
Changed the summary to better reflect the bug's nature.

Quoting the ML post linked to in comment 3:

"CPUTYPE=native hasn't been tested on arm at all. Clearly our implementation of it is broken. That's the real bug here. We either should implement it correctly, which would take some doing, or we should make -march=native return an error on those systems where it isn't done right.

You are correct: in the mean time, please remove this. It works on x86, it seems, but doesn't on arm."
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2021-06-30 01:01:55 UTC
^Triage: close as OBE.

I'm sorry that this PR did not get addressed in a timely fashion.  Please let us know if this still occurs on a supported OSVERSION.