makepkg build problem on armv6 only

Development on core packages and the distribution goes on in here.

makepkg build problem on armv6 only

Postby keithspg » Wed Mar 25, 2020 1:32 pm

First off, I am not an expert at this at all. I have bumbled through making PKGBUILDs and stuff for packages I have wanted to build and been successful in the past. I am lost with this error, though. I have a PKGBUILD that builds fine on x64 and armv7, but when I try to build it on armv6, It fails and get a ton of "undefined reference to" errors as if it cannot find the directory. It only does this on armv6h (RPi). The package I am building is mDNSResponder. I found an old PKGBUILD and associated files and was able to edit it to get the latest package from apple to build and I have tested it to work on both x64 and armv7. If I attempt the build on armv6 and get the error then go back into the src directory and type 'make', it makes fine and the resulting binaries work.
This is what I get:
Code: Select all
Bunch of normal messages that it is building then
...
LINUX -ftabstop=4 -Wno-expansion-to-defined -g -DMDNS_DEBUGMSGS=0  -c -o objects/prod/NetMonitor.c.o NetMonitor.c
dns-sd.c: In function ‘qr_reply’:
dns-sd.c:1077:5: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
 1077 |     strncpy(rr_type, DNSTypeName(rrtype), sizeof(rr_type));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cco2JWcU.o: in function `API_string_limit_test':
/tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:1486: undefined reference to `DNSServiceGetAddrInfo'
/usr/bin/ld: /tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:1493: undefined reference to `DNSServiceGetAddrInfo'
/usr/bin/ld: /tmp/cco2JWcU.o: in function `API_NULL_input_test':
/tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:1553: undefined reference to `DNSServiceGetProperty'
/usr/bin/ld: /tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:1554: undefined reference to `DNSServiceGetProperty'
/usr/bin/ld: /tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:1555: undefined reference to `DNSServiceGetProperty'
/usr/bin/ld: /tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:1617: undefined reference to `DNSServiceGetAddrInfo'
/usr/bin/ld: /tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:1618: undefined reference to `DNSServiceGetAddrInfo'
/usr/bin/ld: /tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:1619: undefined reference to `DNSServiceGetAddrInfo'
/usr/bin/ld: /tmp/cco2JWcU.o: in function `main':
/tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:2223: undefined reference to `DNSServiceGetAddrInfo'
/usr/bin/ld: /tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:2202: undefined reference to `DNSServiceNATPortMappingCreate'
/usr/bin/ld: /tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:2264: undefined reference to `DNSServiceGetProperty'
/usr/bin/ld: /tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients/dns-sd.c:2193: undefined reference to `DNSServiceNATPortMappingCreate'
collect2: error: ld returned 1 exit status
distcc[31206] ERROR: compile dns-sd.c on localhost failed
make[1]: *** [Makefile:57: build/dns-sd] Error 1
make[1]: Leaving directory '/tmp/makepkg/mdnsresponder/src/mDNSResponder-1096.0.2/Clients'
make: *** [Makefile:296: ../Clients/build/dns-sd] Error 2
make: *** Waiting for unfinished jobs....
In file included from NetMonitor.c:25:
../mDNSCore/mDNS.c: In function 'mDNSCoreReceiveRawARP':
../mDNSCore/mDNS.c:13903:53: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
../mDNSCore/mDNS.c:13903:90: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]

If I then go to the folder
Code: Select all
src/mDNSResponder-1096.0.2/mDNSPosix/

and type 'make' it builds the binaries and libraries in build/prod/ where they belong.
Any idea what is going on and why it builds fine with armv7 but armv6?
The PKGBUILD is here:
Code: Select all
pkgname=mdnsresponder
true && pkgname=('mdnsresponder' 'nss-mdnsresponder')
pkgver=1096.0.2
pkgrel=1
pkgdesc="Apple's official implementation of mDNS/DNS-SD/Bonjour/Zeroconf"
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
url='https://developer.apple.com/opensource/'
license=('CUSTOM')
depends=('glibc')
options=('!libtool')
install=$pkgname.install
changelog=$pkgname.changelog
source=(dnsextd.rc \
        mdnsd.rc \
        nss-mdnsresponder.install \
        linux_1.patch \
        http://www.opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-$pkgver.tar.gz)

md5sums=('4162d5c457b4dcdf79dc6e75d5cc1977'
         'bcaaabccb30111573e36c750341db78c'
         'fa87aeb60f79a34fe26d570c16494844'
         '5ee24e86a8e24692e8051f37b001f9bc'
         '7d4aef972b133c650593034b2dd7a786')

prepare() {
    msg2 'Patching for Linux'
    cd mDNSResponder-$pkgver
    patch --forward --strip=1 --input="${srcdir}/linux_1.patch"
}


build() {
        if [ "$(echo $srcdir|grep -E '[ "]')" ];then
        error 'Spaces found in path, this will break the Makefile';exit 1;fi
        cd mDNSResponder-$pkgver/mDNSPosix
        if [ ! -f fixed ];then fix;fi
        msg2 'Making mDNSResponder...'
        make os=linux
}
fix() {
        msg2 'Fixing Makefile...'
        sed -i 's/CP = cp/CP = install -D/' Makefile
        sed -i 's/LN = ln -s -f/LN = ln -rs/' Makefile
        sed -i 's/cp \$/$(CP) $/' Makefile
        sed -i 's;NSSINSTPATH := ;NSSINSTPATH := $(DESTDIR)/usr;' Makefile
        sed -i 's/INSTBASE?=/INSTBASE?=$(DESTDIR)/' Makefile
        sed -i 's/STARTUPSCRIPTNAME?=mdns/STARTUPSCRIPTNAME?=mdnsd/' Makefile
        sed -i 's/MANPATH := /MANPATH := $(DESTDIR)/' Makefile
        sed -i 's:STARTUPSCRIPTDIR = $(INSTBASE)/etc/rc.d:STARTUPSCRIPTDIR = $(DESTDIR)/etc/rc.d:' Makefile
        sed -i 's:/etc/nss_mdns.conf:$(DESTDIR)/etc/nss_mdns.conf:' Makefile
        sed -i 's/cp -f/#cp -f/' Makefile
        sed -i 's/sed -e/#sed -e/' Makefile
        sed -i 's/\tldconfig/\t#ldconfig/' Makefile
        sed -i 's/\$@ start/#$@ start/' Makefile
        echo -e '\n$(STARTUPSCRIPTDIR): $(DESTDIR)\n\tmkdir -p $<' >>Makefile
        :>fixed
}
package_mdnsresponder() {
        backup=('etc/dnsextd.conf')
        cd mDNSResponder-$pkgver/mDNSPosix
        msg2 'Building...'
        make os=linux DESTDIR="$pkgdir" OPTINSTALL= install
        install -m755 "$srcdir"/dnsextd.rc "$pkgdir"/etc/rc.d/dnsextd
        install -m755 "$srcdir"/mdnsd.rc "$pkgdir"/etc/rc.d/mdnsd
        install -d "$pkgdir"/usr/share/man/man1
        install -D -m444 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
        install -m444 ../mDNSShared/dns-sd.1 "$pkgdir"/usr/share/man/man1/
        install -m444 ../mDNSShared/{dnsextd,mDNSResponder}.8 "$pkgdir"/usr/share/man/man8
        install -m444 ../mDNSShared/dnsextd.conf "$pkgdir"/etc
        cp build/prod/mDNSNetMonitor "$pkgdir"/usr/bin
        cp build/prod/mDNS{Client,Responder,ProxyResponder}Posix "$pkgdir"/usr/bin
}
package_nss-mdnsresponder() {
        provides=('nss-mdns');conflicts=(${provides[@]});backup=('etc/nss_mdns.conf')
        true && pkgdesc="Apple's official implementation of mdns host name resolution"
        install=$pkgname.install
        cd mDNSResponder-$pkgver/mDNSPosix
        msg2 'Building...'
        make os=linux DESTDIR="$pkgdir" InstalledNSS
        install -D -m444 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
keithspg
 
Posts: 46
Joined: Mon Feb 23, 2015 4:14 pm

Return to Arch Linux ARM

Who is online

Users browsing this forum: No registered users and 1 guest