Bug 199388

Summary: Compilation of databases/tokyocabinet 1.4.48 on FreeBSD 10.1 fails with cc: error: unknown argument: '-fforce-addr' (CLANG)
Product: Ports & Packages Reporter: sebastian
Component: Individual Port(s)Assignee: Jun Kuriyama <kuriyama>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: sebastian, w.schwarzenfeld
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   

Description sebastian 2015-04-12 08:29:13 UTC
Hi,

I am trying to install the port php56-extensions, which inter alia contains tokyocabinet as one of its dependencies. When trying to install the tokyocabinet port on FreeBSD 10.1 I am getting the following error message:

root@waldfest /usr/ports/lang/php56-extensions]# make MAKE_JOBS_UNSAFE=yes
===>   php56-extensions-1.0 depends on file: /usr/local/include/php/main/php.h - found
===>   php56-extensions-1.0 depends on file: /usr/local/lib/php/20131226/bcmath.so - found
===>   php56-extensions-1.0 depends on file: /usr/local/lib/php/20131226/bz2.so - found
===>   php56-extensions-1.0 depends on file: /usr/local/lib/php/20131226/calendar.so - found
===>   php56-extensions-1.0 depends on file: /usr/local/lib/php/20131226/ctype.so - found
===>   php56-extensions-1.0 depends on file: /usr/local/lib/php/20131226/curl.so - found
===>   php56-extensions-1.0 depends on file: /usr/local/lib/php/20131226/dba.so - not found
===>    Verifying install for /usr/local/lib/php/20131226/dba.so in /usr/ports/databases/php56-dba
===>   php56-dba-5.6.6 depends on file: /usr/local/bin/phpize - found
===>   php56-dba-5.6.6 depends on file: /usr/local/bin/autoconf-2.69 - found
===>   php56-dba-5.6.6 depends on shared library: libgdbm.so - found (/usr/local/lib/libgdbm.so.4.0.0)
===>   php56-dba-5.6.6 depends on shared library: libqdbm.so - found (/usr/local/lib/libqdbm.so.14.14.0)
===>   php56-dba-5.6.6 depends on shared library: libtokyocabinet.so - not found
===>    Verifying for libtokyocabinet.so in /usr/ports/databases/tokyocabinet
===>  Building for tokyocabinet-1.4.48
gmake[6]: Entering directory '/usr/ports/databases/tokyocabinet/work/tokyocabinet-1.4.48'
cc -c -I. -I/usr/local/include -I/usr/ports/databases/tokyocabinet/work/include -I/usr/local/include -DNDEBUG -D_GNU_SOURCE=1 -D_REENTRANT -D__EXTENSIONS__ -UNDEBUG -UNDEBUG -D_MYFASTEST -D_MYSWAB -D_MYMICROYIELD -D_MYEXLZMA -D_MYEXLZO -D_TC_PREFIX="\"/usr/local\"" -D_TC_INCLUDEDIR="\"/usr/local/include\"" -D_TC_LIBDIR="\"/usr/local/lib\"" -D_TC_BINDIR="\"/usr/local/bin\"" -D_TC_LIBEXECDIR="\"/usr/local/libexec\"" -D_TC_APPINC="\"-I/usr/local/include\"" -D_TC_APPLIBS="\"-L/usr/local/lib -ltokyocabinet -llzo2 -llzma -lbz2 -lz -lrt -lpthread -lm -lc \"" -pipe  -g -fstack-protector -fno-strict-aliasing -std=c99 -Wall -fPIC -pedantic -fsigned-char -O3 -fomit-frame-pointer -fforce-addr -minline-all-stringops tokyocabinet_all.c
cc: error: unknown argument: '-fforce-addr'
Makefile:72: recipe for target 'tokyocabinet_all.o' failed
gmake[6]: *** [tokyocabinet_all.o] Error 1
gmake[6]: Leaving directory '/usr/ports/databases/tokyocabinet/work/tokyocabinet-1.4.48'
*** Error code 1

Stop.
make[5]: stopped in /usr/ports/databases/tokyocabinet
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/databases/tokyocabinet
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/databases/php56-dba
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/databases/php56-dba
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/php56-extensions
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/php56-extensions

[root@bla /usr/ports/lang/php56-extensions]# uname -a
FreeBSD bla 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

I also tried to remove the CFLAG (see http://lists.freebsd.org/pipermail/svn-ports-all/2014-February/047425.html for a similar issue) but that did not bring much success except for loads of compiler warnings and linker errors. Any ideas? I also reported this to the package maintainer (kuriyama@freebsd.org) but I did not yet get any feedback.

Many thanks.

Kind regards
Sebastian
Comment 1 Jun Kuriyama freebsd_committer freebsd_triage 2015-05-06 14:51:58 UTC
Hmm, I can build this port on 10.1.  What options do you choose?
Comment 2 sebastian 2015-05-07 21:54:35 UTC
Hi,

what specific options/files do you need other than the ones displayed in the extract I provided?

Kind regards
Sebastian
Comment 3 sebastian 2015-05-10 09:45:11 UTC
Hi,

just to add onto this. So it seems that clang does not support fforce-addr and as such building tokyocabinet fails to build. Removing the flag from the Makefile does result in a number of compilation errors:

[root@bla /usr/ports/databases/tokyocabinet/work/tokyocabinet-1.4.48]# make MAKE_JOBS_UNSAFE=yes
cc -c -I. -I/usr/local/include -I/usr/ports/databases/tokyocabinet/work/include -I/usr/local/include -DNDEBUG -D_GNU_SOURCE=1 -D_REENTRANT -D__EXTENSIONS__ -UNDEBUG -UNDEBUG -D_MYFASTEST -D_MYSWAB -D_MYMICROYIELD -D_MYEXLZMA -D_MYEXLZO  -D_TC_PREFIX="\"/usr/local\"" -D_TC_INCLUDEDIR="\"/usr/local/include\""  -D_TC_LIBDIR="\"/usr/local/lib\"" -D_TC_BINDIR="\"/usr/local/bin\"" -D_TC_LIBEXECDIR="\"/usr/local/libexec\""  -D_TC_APPINC="\"-I/usr/local/include\"" -D_TC_APPLIBS="\"-L/usr/local/lib -ltokyocabinet -llzo2 -llzma -lbz2 -lz -lrt -lpthread -lm -lc \"" -pipe  -g -fstack-protector -fno-strict-aliasing -std=c99 -Wall -fPIC -pedantic -fsigned-char -O3 -fomit-frame-pointer -minline-all-stringops tokyocabinet_all.c
tokyocabinet_all.c:123:5: warning: variable 'swap' is used uninitialized whenever '&&' condition is false
      [-Wsometimes-uninitialized]
    if(!(swap = MYREALLOC(buf, asiz))){
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./myconf.h:423:6: note: expanded from macro 'if'
  if((((++_tc_dummy_cnt) & (0x100 - 1)) != 0 || (sched_yield() * 0) == 0) && (TC_cond))
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tokyocabinet_all.c:128:11: note: uninitialized use occurs here
    buf = swap;
          ^~~~
tokyocabinet_all.c:123:5: note: remove the '&&' if its condition is always true
    if(!(swap = MYREALLOC(buf, asiz))){
    ^
./myconf.h:423:6: note: expanded from macro 'if'
  if((((++_tc_dummy_cnt) & (0x100 - 1)) != 0 || (sched_yield() * 0) == 0) && (TC_cond))
     ^
tokyocabinet_all.c:122:15: note: initialize the variable 'swap' to silence this warning
    char *swap;
              ^
               = NULL

(...)

Are you not having the same issue? Which compiler are you using? Any special flags?

Thanks.

Kind regards
Sebastian
Comment 4 Walter Schwarzenfeld 2018-01-12 04:44:37 UTC
IMHO tokyocabinet compiles fine. Maintainer feedback please! I think this could be closed.