Bug 172204 - net/vtun: fails to compile (clang)/fails to install (gcc)
net/vtun: fails to compile (clang)/fails to install (gcc)
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Cy Schubert
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-01 11:30 UTC by Bernard Spil
Modified: 2013-02-14 05:40 UTC (History)
0 users

See Also:


Attachments
net-vtun.patch (1.13 KB, patch)
2013-02-12 03:44 UTC, ktsin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernard Spil freebsd_committer 2012-10-01 11:30:03 UTC
Can't build/install vtun-3.0.3

CPUTYPE?=native
CFLAGS= -O2 -fno-strict-aliasing -pipe

Using clang:
clang -O2 -fno-strict-aliasing -pipe -march=native  -I/usr/include/openssl -I/usr/local/include/lzo -I/usr/include/openssl -I/usr/include/openssl -I/usr/include/open
ssl -I/usr/include/openssl -o vtund main.o cfg_file.tab.o cfg_file.lex.o server.o client.o lib.o  llist.o auth.o tunnel.o lock.o netlib.o   tun_dev.o tap_dev.o pty_d
ev.o pipe_dev.o  tcp_proto.o udp_proto.o  linkfd.o lfd_shaper.o lfd_zlib.o lfd_lzo.o lfd_encrypt.o lfd_legacy_encrypt.o  -rpath=/usr/lib:/usr/local/lib  -L/usr/lib -
L/usr/local/lib -lz -llzo2 -lcrypto
clang: warning: argument unused during compilation: '-rpath=/usr/lib:/usr/local/lib'
main.o: In function `main':
main.c:(.text+0x334): undefined reference to `clear_nat_hack_flags'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Using gcc (from base) it fails during install
===>  Installing for vtun-3.0.3
===>   Generating temporary packing list
===>  Checking if net/vtun already installed
if [ ! -f /usr/local/etc/vtund.conf ]; then  /usr/bin/install -c -o root -g wheel -m 600 -o root -g 0 vtund.conf /usr/local/etc;  fi
/usr/bin/install -c -o root -g wheel -m 644 -o root -g 0 vtund.8 /usr/local/man/man8
/usr/bin/install -c -o root -g wheel -m 644 -o root -g 0 vtund.conf.5 /usr/local/man/man5
rm -f /usr/local/man/man8/vtun.8
ln -s vtund.8 /usr/local/man/man8/vtun.8
/usr/bin/install -c -o root -g wheel -d -m 755 -o root -g 0 /var/log/vtund
/usr/bin/install -c -o root -g wheel -d -m 755 -o root -g 0 /var/lock/vtund
/usr/bin/install -c -o root -g wheel -m 755 -o root -g 0 vtund /usr/local/sbin
/usr/local/bin/strip /usr/local/sbin/vtund
/usr/local/bin/strip: No such file or directory
*** Error code 1

Tried to find where the /usr/local/bin/strip comes from but all I can find is install-sh which doesn't seem to set stripcmd itself or sets it relative.

How-To-Repeat: Upgrade vtun-3.0.2 to vtun-3.0.3
Comment 1 Edwin Groothuis freebsd_committer 2012-10-01 11:30:27 UTC
Responsible Changed
From-To: freebsd-ports-bugs->cy

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Bernard Spil freebsd_committer 2012-10-03 15:58:51 UTC
Tested again this morning, gcc is now succesful. Guess I forgot a make
clean between the runs. clang build is still failing.
Comment 3 ktsin 2013-02-12 03:44:49 UTC
patches to unbreak vtun when compiling under clang.
Comment 4 Cy Schubert freebsd_committer 2013-02-14 05:20:17 UTC
State Changed
From-To: open->closed

Fixed. Submitted patch incomplete.
Comment 5 dfilter freebsd_committer 2013-02-14 05:33:16 UTC
Author: cy
Date: Thu Feb 14 05:33:03 2013
New Revision: 312193
URL: http://svnweb.freebsd.org/changeset/ports/312193

Log:
  Fix PR 172204 (failure to build using CLANG).
  
  PR:		172204

Added:
  head/net/vtun/files/extra-cfg_file.y   (contents, props changed)
Modified:
  head/net/vtun/Makefile

Modified: head/net/vtun/Makefile
==============================================================================
--- head/net/vtun/Makefile	Thu Feb 14 05:10:09 2013	(r312192)
+++ head/net/vtun/Makefile	Thu Feb 14 05:33:03 2013	(r312193)
@@ -30,9 +30,15 @@ ALL_TARGET=	vtund
 DOCS=		ChangeLog Credits FAQ README README.LZO README.Setup \
 		README.Shaper TODO
 
+.include <bsd.port.pre.mk>
+
+.if ${CC} == "clang" || ${CXX} == "clang++" || ${OSVERSION} >= 1000026
+EXTRA_PATCHES+= ${FILESDIR}/extra-cfg_file.y
+.endif
+
 .if defined(VTUN_EXTENDED_MODE)
 # Obtained from http://home.jp.FreeBSD.org/~simokawa/vtun-v6.html
-EXTRA_PATCHES=	${FILESDIR}/extra-tun_dev.c
+EXTRA_PATCHES+=	${FILESDIR}/extra-tun_dev.c
 .endif
 
 post-install:
@@ -45,4 +51,4 @@ post-install:
 .endfor
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Added: head/net/vtun/files/extra-cfg_file.y
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/vtun/files/extra-cfg_file.y	Thu Feb 14 05:33:03 2013	(r312193)
@@ -0,0 +1,11 @@
+--- cfg_file.y.orig	2012-07-09 09:01:08.000000000 +0800
++++ cfg_file.y	2013-02-12 11:33:52.000000000 +0800
+@@ -609,7 +609,7 @@
+ }
+ 
+ /* Clear the VTUN_NAT_HACK flag which are not relevant to the current operation mode */
+-inline void clear_nat_hack_flags(int svr)
++void clear_nat_hack_flags(int svr)
+ {
+ 	if (svr)
+ 		llist_trav(&host_list,clear_nat_hack_server,NULL);
_______________________________________________
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"