Bug 217216 - net/freeswitch:Version 1.6.13 fails to compile
Summary: net/freeswitch:Version 1.6.13 fails to compile
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-18 23:55 UTC by Rajil Saraswat
Modified: 2017-03-18 20:20 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (corsmith)


Attachments
Build log (71.97 KB, application/gzip)
2017-03-05 14:31 UTC, Rajil Saraswat
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rajil Saraswat 2017-02-18 23:55:49 UTC
Following is the compile error when using poudriere

making all mod_http_cache
gmake[5]: Entering directory '/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/mod/applications/mod_http_cache'
/bin/sh /wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/libtool  --tag=CC   --mode=compile cc -DHAVE_CONFIG_H -I. -I../../../../src/include -I../../../../libs/esl/src/include -I../../../../libs/xmlrpc-c  -I/usr/local/include   -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/libs/libteletone/src -fPIC -DLIBICONV_PLUG -isystem /usr/local/include -I/usr/local/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/libs/libteletone/src -fPIC -Werror -DENABLE_ZRTP -I/usr/local/include -DHAVE_OPENSSL -Wall -std=c99 -pedantic -Wdeclaration-after-statement -O2 -pipe  -Wno-c11-extensions -Wno-deprecated-declarations -Wno-zero-length-array -Wno-incompatible-pointer-types -DLIBICONV_PLUG -fstack-protector -DLDAP_DEPRECATED -isystem /usr/local/include -fno-strict-aliasing -Wno-extended-offsetof -MT mod_http_cache_la-mod_http_cache.lo -MD -MP -MF .deps/mod_http_cache_la-mod_http_cache.Tpo -c -o mod_http_cache_la-mod_http_cache.lo `test -f 'mod_http_cache.c' || echo './'`mod_http_cache.c
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I../../../../src/include -I../../../../libs/esl/src/include -I../../../../libs/xmlrpc-c -I/usr/local/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/libs/libteletone/src -fPIC -DLIBICONV_PLUG -isystem /usr/local/include -I/usr/local/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/include -I/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/libs/libteletone/src -fPIC -Werror -DENABLE_ZRTP -I/usr/local/include -DHAVE_OPENSSL -Wall -std=c99 -pedantic -Wdeclaration-after-statement -O2 -pipe -Wno-c11-extensions -Wno-deprecated-declarations -Wno-zero-length-array -Wno-incompatible-pointer-types -DLIBICONV_PLUG -fstack-protector -DLDAP_DEPRECATED -isystem /usr/local/include -fno-strict-aliasing -Wno-extended-offsetof -MT mod_http_cache_la-mod_http_cache.lo -MD -MP -MF .deps/mod_http_cache_la-mod_http_cache.Tpo -c mod_http_cache.c  -fPIC -DPIC -o .libs/mod_http_cache_la-mod_http_cache.o
mod_http_cache.c:956:31: error: implicit declaration of function 'strndup' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                char *found_extension_dup = strndup(found_extension, found_extension_len);
                                            ^
mod_http_cache.c:956:31: note: did you mean 'strdup'?
/usr/include/string.h:85:7: note: 'strdup' declared here
char    *strdup(const char *) __malloc_like;
         ^
mod_http_cache.c:956:9: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Werror,-Wint-conversion]
                char *found_extension_dup = strndup(found_extension, found_extension_len);
                      ^                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
gmake[5]: *** [Makefile:576: mod_http_cache_la-mod_http_cache.lo] Error 1
gmake[5]: Leaving directory '/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/mod/applications/mod_http_cache'
gmake[4]: *** [Makefile:588: mod_http_cache-all] Error 1
gmake[4]: Leaving directory '/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src/mod'
gmake[3]: *** [Makefile:484: all-recursive] Error 1
gmake[3]: Leaving directory '/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13/src'
gmake[2]: *** [Makefile:3004: all-recursive] Error 1
gmake[2]: Leaving directory '/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13'
gmake[1]: *** [Makefile:1123: all] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/net/freeswitch/work/freeswitch-1.6.13'
*** Error code 1

Stop.
make: stopped in /usr/ports/net/freeswitch
====>> Cleaning up wrkdir
Comment 1 Bartek Rutkowski freebsd_committer freebsd_triage 2017-02-21 10:35:10 UTC
I've just tested it and it builds successfully on 12/11/10.x amd64/i386 systems. Can you reproduce the same issue on freshly installed OS (in a virtual machine or jail)? How does your make.conf looks like?
Comment 2 Martin Wilke freebsd_committer freebsd_triage 2017-03-05 13:57:39 UTC
Hi,

I close this here since there is no feedback.
Comment 3 Rajil Saraswat 2017-03-05 14:05:15 UTC
Following are the contents of /usr/local/etc/poudriere.d/make.conf

# No X11, HAL or NLS. These are set globally for every port.
OPTIONS_UNSET= X11
OPTIONS_UNSET= HAL
OPTIONS_UNSET= NLS


# Use the port version OpenSSL where possible
WITH_OPENSSL_PORT=yes


# ftp/curl. Avoid linking to base system OpenSSL libraries.
ftp_curl_SET= GSSAPI_NONE
ftp_curl_UNSET= GSSAPI_BASE

#Use pgsql 9.4
DEFAULT_VERSIONS+= pgsql=9.4
Comment 4 Rajil Saraswat 2017-03-05 14:31:03 UTC
Created attachment 180538 [details]
Build log

The build log is attached.
Comment 5 Palle Girgensohn freebsd_committer freebsd_triage 2017-03-16 13:53:52 UTC
(In reply to Rajil Saraswat from comment #3)

Just a comment, you know that this will OPTIONS_UNSET to only contain "NLS":

# No X11, HAL or NLS. These are set globally for every port.
OPTIONS_UNSET= X11
OPTIONS_UNSET= HAL
OPTIONS_UNSET= NLS



I think what you want is 

OPTIONS_UNSET=X11 HAL NLS

or

OPTIONS_UNSET= X11
OPTIONS_UNSET+= HAL
OPTIONS_UNSET+= NLS
Comment 6 Rajil Saraswat 2017-03-18 16:09:14 UTC
Thanks for pointing that out.
Comment 7 Palle Girgensohn freebsd_committer freebsd_triage 2017-03-18 18:04:53 UTC
It is a bug upstreama that Linus does not realise. 

The fix is to add 

#define XOPEN_SOURCE 700

to the beginning of the c file failing, mod_http_cache.c

I've filed a big report upstreama and will suggest a fix once I'm back at a computer.
Comment 8 Palle Girgensohn freebsd_committer freebsd_triage 2017-03-18 20:20:29 UTC
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217899 for fix and update to latest version of freeswitch