Bug 183212 - [patch] net/mDNSResponder with clang/arm
Summary: [patch] net/mDNSResponder with clang/arm
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-22 19:40 UTC by Matthieu Volat
Modified: 2013-11-11 14:20 UTC (History)
0 users

See Also:


Attachments
file.diff (330 bytes, patch)
2013-10-22 19:40 UTC, Matthieu Volat
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Volat 2013-10-22 19:40:00 UTC
On the arm architecture (tested on a raspberry pi), when using clang as port compiler, net/mDNSResponder will fail with the following message:

gmake[2]: Entering directory `/usr/ports/net/mDNSResponder/work/mDNSResponder-379.38.1/Clients'
mkdir build
cc dns-sd.c ClientCommon.c -L../mDNSPosix/build/prod/ -ldns_sd -I../mDNSShared -Wall -o build/dns-sd
/usr/bin/ld: build/dns-sd: hidden symbol `__aeabi_memcpy' in /usr/lib/libgcc.a(aeabi_memcpy.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [build/dns-sd] Error 1
gmake[2]: Leaving directory `/usr/ports/net/mDNSResponder/work/mDNSResponder-379.38.1/Clients'
gmake[1]: *** [../Clients/build/dns-sd] Error 2
gmake[1]: Leaving directory `/usr/ports/net/mDNSResponder/work/mDNSResponder-379.38.1/mDNSPosix'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/net/mDNSResponder

This is because mDNSResponder try to link the libdns_sd library using ld(1) which do not work well on arm.

Fix: One workaround that should work on all platform and with both gcc and clang is to set the LD variable to "${CC} -shared".

Here's the patch :
How-To-Repeat: On a arm platform :
# cd /usr/ports/mDNSResponder
# make CC=clang
Comment 1 Edwin Groothuis freebsd_committer 2013-10-22 19:40:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sunpoet

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2013-11-11 14:16:54 UTC
Author: sunpoet
Date: Mon Nov 11 14:16:47 2013
New Revision: 333507
URL: http://svnweb.freebsd.org/changeset/ports/333507

Log:
  - Fix build on arm
  
  Thanks to kevlo for testing on arm architecture.
  
  PR:		ports/183212
  Submitted by:	Matthieu Volat <mazhe@alkumuna.eu>
  Tested by:	kevlo

Modified:
  head/net/mDNSResponder/Makefile

Modified: head/net/mDNSResponder/Makefile
==============================================================================
--- head/net/mDNSResponder/Makefile	Mon Nov 11 14:16:05 2013	(r333506)
+++ head/net/mDNSResponder/Makefile	Mon Nov 11 14:16:47 2013	(r333507)
@@ -26,6 +26,12 @@ EXTRA_MAN1=	dns-sd.1
 EXTRA_MAN8=	dnsextd.8 mDNSResponderPosix.8
 EXTRA_SBIN=	dnsextd
 
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == "arm"
+MAKE_ARGS+=	LD="${CC} -shared"
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e '/	cc / s|cc|$${CC}|' ${WRKSRC}/Clients/Makefile
 	@${REINPLACE_CMD} -e 's|-lpthread|-pthread|g; s|mDNSResponder.8|mDNSResponderPosix.8|g' ${WRKSRC}/mDNSPosix/Makefile
@@ -41,4 +47,4 @@ post-install:
 	cd ${WRKSRC}/mDNSShared/ && ${INSTALL_MAN} ${EXTRA_MAN8} ${STAGEDIR}${PREFIX}/man/man8/
 	cd ${WRKSRC}/mDNSPosix/build/prod/ && ${INSTALL_PROGRAM} ${EXTRA_SBIN} ${STAGEDIR}${PREFIX}/sbin/
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Po-Chuan Hsieh freebsd_committer 2013-11-11 14:16:55 UTC
State Changed
From-To: open->closed

Committed. Thanks!