[Bug 205904] 11.0-CURRENT -r293129 arm -mcpu=cortex-a7: unresolvable R_ARM_MOVW_ABS_NC relocation against symbol `malloc@@FBSD_1.0'

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Jan 4 22:02:42 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205904

            Bug ID: 205904
           Summary: 11.0-CURRENT -r293129 arm -mcpu=cortex-a7:
                    unresolvable R_ARM_MOVW_ABS_NC relocation against
                    symbol `malloc@@FBSD_1.0'
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: arm
          Assignee: freebsd-arm at FreeBSD.org
          Reporter: markmi at dsl-only.net

I updated to (via a cross build from amd64 that was based on -march=armv7-a
-mcpu=cortex-a7):

# freebsd-version -ku; uname -aKU
11.0-CURRENT
11.0-CURRENT
FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #8 r293129M: Sun Jan  3 20:37:26
PST 2016     root at FreeBSDx64:/usr/obj/clang/arm.armv6/usr/src/sys/RPI2-NODBG 
arm 1100093 1100093

on an rpi2b in order to pick up and try out:

BEGIN -r292964 description
Author: ian
Date: Wed Dec 30 23:04:08 2015
New Revision: 292964
URL: https://svnweb.freebsd.org/changeset/base/292964

Log:
  Add the MOVT/MOVW types to the list of relocs which do not generate .plt
  entries.  This fixes the segfaults in arm userland code compiled with
  -march= or -mcpu= values that allow the compiler to generate movw/movt
  sequences to load 32-bit constants.

Modified:
  head/contrib/binutils/bfd/elf32-arm.c
END -r292964 description

instead of using /usr/local/arm-gnueabi-freebsd/bin/* binutils as I have been
experimenting with.

I tried something simple and C-based on the rpi2:

portmaster -DK textproc/expat2

based on:

# more /etc/make.conf 
DEFAULT_VERSIONS+=perl5=5.22
WRKDIRPREFIX=/usr/obj/portswork
WITH_DEBUG=
WITH_DEBUG_FILES=
MALLOC_PRODUCTION=
TO_TYPE=armv6
TOOLS_TO_TYPE=arm-gnueabi
VERSION_CONTEXT=11.0
.if ${.MAKE.LEVEL} == 0
CC=/usr/bin/clang -v -target ${TO_TYPE}--freebsd${VERSION_CONTEXT}-gnueabi
-march=armv7-a -mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access
CXX=/usr/bin/clang++ -v -target ${TO_TYPE}--freebsd${VERSION_CONTEXT}-gnueabi
-march=armv7-a -mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access
CPP=/usr/bin/clang-cpp -v -target ${TO_TYPE}--freebsd${VERSION_CONTEXT}-gnueabi
-march=armv7-a -mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access
.export CC
.export CXX
.export CPP
.endif

(Note the -v's that show extra context during the command executions.)

The failing result involving movw was "unresolvable R_ARM_MOVW_ABS_NC
relocation against symbol `malloc@@FBSD_1.0'":

/bin/sh ./libtool --silent --mode=link /usr/bin/clang -v -target
armv6--freebsd11.0-gnueabi -march=armv7-a -mcpu=cortex-a7 -mfloat-abi=softfp
-mno-unaligned-access -I./lib -I. -pipe -mfloat-abi=softfp  -g
-fno-strict-aliasing -Wall -Wmissing-prototypes -Wstrict-prototypes
-fexceptions  -DHAVE_EXPAT_CONFIG_H -no-undefined -version-info 7:0:6 -rpath
/usr/local/lib  -o libexpat.la lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo
FreeBSD clang version 3.7.1 (tags/RELEASE_371/final 255217) 20151225
Target: armv6--freebsd11.0-gnueabi
Thread model: posix
 "/usr/bin/ld" --eh-frame-hdr -Bshareable --hash-style=both --enable-new-dtags
-o .libs/libexpat.so.1.6.0 /usr/lib/crti.o /usr/lib/crtbeginS.o -L/usr/lib
lib/.libs/xmlparse.o lib/.libs/xmltok.o lib/.libs/xmlrole.o -soname
libexpat.so.1 -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed
-lgcc_s --no-as-needed /usr/lib/crtendS.o /usr/lib/crtn.o
/usr/bin/ld: lib/.libs/xmlparse.o(.text+0x198): unresolvable R_ARM_MOVW_ABS_NC
relocation against symbol `malloc@@FBSD_1.0'
/usr/bin/ld: final link failed: Nonrepresentable section on output
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[1]: stopped in
/usr/obj/portswork/usr/ports/textproc/expat2/work/expat-2.1.0
*** Error code 1



For reference: here is one of the prior C compiles (xmlparse.c -> xmlparse.o as
referenced in the failure):

/bin/sh ./libtool --silent --mode=compile /usr/bin/clang -v -target
armv6--freebsd11.0-gnueabi -march=armv7-a -mcpu=cortex-a7 -mfloat-abi=softfp
-mno-unaligned-access -I./lib -I. -pipe -mfloat-abi=softfp  -g
-fno-strict-aliasing -Wall -Wmissing-prototypes -Wstrict-prototypes
-fexceptions  -DHAVE_EXPAT_CONFIG_H -o lib/xmlparse.lo -c lib/xmlparse.c
FreeBSD clang version 3.7.1 (tags/RELEASE_371/final 255217) 20151225
Target: armv6--freebsd11.0-gnueabi
Thread model: posix
 "/usr/bin/clang" -cc1 -triple armv7--freebsd11.0-gnueabi -emit-obj -mrelax-all
-disable-free -main-file-name xmlparse.c -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose
-mconstructor-aliases -target-cpu cortex-a7 -target-feature +soft-float-abi
-target-abi aapcs-linux -mfloat-abi soft -backend-option -arm-strict-align -v
-gdwarf-2 -dwarf-column-info -coverage-file
/usr/obj/portswork/usr/ports/textproc/expat2/work/expat-2.1.0/xmlparse.c
-resource-dir /usr/bin/../lib/clang/3.7.1 -D HAVE_EXPAT_CONFIG_H -I ./lib -I .
-Wall -Wmissing-prototypes -Wstrict-prototypes -fdebug-compilation-dir
/usr/obj/portswork/usr/ports/textproc/expat2/work/expat-2.1.0 -ferror-limit 19
-fmessage-length 200 -mstackrealign -fno-signed-char -fobjc-runtime=gnustep
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o xmlparse.o -x c
lib/xmlparse.c
clang -cc1 version 3.7.1 based upon LLVM 3.7.1 default target
armv6--freebsd11.0-gnueabi
#include "..." search starts here:
#include <...> search starts here:
 ./lib
 .
 /usr/bin/../lib/clang/3.7.1/include
 /usr/include
End of search list.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-arm mailing list