rtl_adsb.o: In function `manchester': rtl_adsb.c:(.text+0x69e): undefined reference to `preamble' cc: error: linker command failed with exit code 1 (use -v to see invocation) --- src/.deps/rtl_adsb.Po clang39 +++ src/.deps/rtl_adsb.Po clang40 @@ -22,6 +22,8 @@ rtl_adsb.o: rtl_adsb.c /usr/include/errn ../include/rtl-sdr.h ../include/rtl-sdr_export.h \ convenience/convenience.h +rtl_adsb.c: + /usr/include/errno.h: /usr/include/sys/cdefs.h: build log: http://sprunge.us/EDbO
Probably the same libtool issue as bug 216043. $ du -h src/rtl_adsb.o 20K src/rtl_adsb.o $ nm src/rtl_adsb.o nm: src/rtl_adsb.o: File truncated $ readelf -a src/rtl_adsb.o ELF Header: Magic: 7f 45 4c 46 02 01 01 09 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - FreeBSD ABI Version: 0 Type: REL (Relocatable file) Machine: Advanced Micro Devices X86-64 Version: 0x1 Entry point address: 0x0 Start of program headers: 0 (bytes into file) Start of section headers: 17376 (bytes into file) Flags: 0x0 Size of this header: 64 (bytes) Size of program headers: 0 (bytes) Number of program headers: 0 Size of section headers: 64 (bytes) Number of section headers: 17 Section header string table index: 1 readelf: Error: Reading 0x440 bytes extends past end of file for section headers readelf: Error: Section headers are not available! There are no program headers in this file.
Oops, ignore comment 1. I've modified WRKDIR to make comparison easier.
Reverting Clang r287138 doesn't help unlike bug 216043. preamble() lacks __attribute__((gnu_inline)) but is used within the same translation unit.
Created attachment 178890 [details] fix, v0
Created attachment 178891 [details] alternative fix, v0
Comment on attachment 178890 [details] fix, v0 This version also fixes build with -O0 or WITH_DEBUG=1 using older Clang or GCC: $ make clean all WITH_DEBUG= [...] rtl_power.o: In function `fix_fft': rtl_power.c:(.text+0x420): undefined reference to `FIX_MPY' rtl_power.c:(.text+0x449): undefined reference to `FIX_MPY' rtl_power.c:(.text+0x478): undefined reference to `FIX_MPY' rtl_power.c:(.text+0x4a1): undefined reference to `FIX_MPY' rtl_adsb.o: In function `manchester': rtl_adsb.c:(.text+0x3de): undefined reference to `preamble' rtl_adsb.c:(.text+0x4b3): undefined reference to `single_manchester' collect2: error: ld returned 1 exit status
A commit references this bug: Author: martymac Date: Mon Jan 16 21:18:27 UTC 2017 New revision: 431703 URL: https://svnweb.freebsd.org/changeset/ports/431703 Log: Fix build with clang 4.0 PR: 216048 Submitted by: jbeich Changes: head/comms/rtl-sdr/Makefile
Committed, thanks Jan!
A commit references this bug: Author: jbeich Date: Thu Jan 19 05:36:25 UTC 2017 New revision: 431850 URL: https://svnweb.freebsd.org/changeset/ports/431850 Log: MFH: r431703 by martymac Fix build with clang 4.0 PR: 216048 Submitted by: jbeich Approved by: ports-secteam blanket Changes: _U branches/2017Q1/ branches/2017Q1/comms/rtl-sdr/Makefile