Bug 192106

Summary: editors/emacs-devel fails to compile with linker error
Product: Ports & Packages Reporter: Robert Cina <transitive>
Component: Individual Port(s)Assignee: Ashish SHUKLA <ashish>
Status: Closed FIXED    
Severity: Affects Only Me CC: marino, rezo
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
config.log
none
pkg_info_output none

Description Robert Cina 2014-07-25 08:58:58 UTC
The port editors/emacs-devel fails to compile with a linker error on my 10.0-stable system.

The output of the linker error is shown below:

sr/local/lib -lXfixes   -L/usr/local/lib -lxml2     -lutil -lncurses  -lgio-2.0 -lgobject-2.0 -L/usr/local/lib -lglib-2.0 -lintl   -lgconf-2 -L/usr/local/lib -lglib-2.0 -lintl   -lgobject-2.0 -L/usr/local/lib -lglib-2.0 -lintl    -L/usr/local/lib -lfreetype   -lfontconfig -L/usr/local/lib -lfreetype   -lz -lbz2 -lotf -L/usr/local/lib -lfreetype   -lm17n-flt -L/usr/local/lib -lm17n-core   -L/usr/local/lib -lgnutls    -lgio-2.0 -lgobject-2.0 -L/usr/local/lib -lglib-2.0 -lintl   -lm -lz
/usr/bin/ld: warning: libbz2.so.4, needed by /usr/local/lib/libfreetype.so, may conflict with libbz2.so.1
alloc.o: In function `Fmemory_info':
alloc.c:(.text+0x6dad): undefined reference to `sysinfo'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [temacs] Error 1
gmake[3]: Leaving directory `/usr/ports/editors/emacs-devel/work/emacs-24.4.50.117564/src'
gmake[2]: *** [src] Error 2
gmake[2]: Leaving directory `/usr/ports/editors/emacs-devel/work/emacs-24.4.50.117564'
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/editors/emacs-devel
*** Error code 1

Stop.
make: stopped in /usr/ports/editors/emacs-devel
Comment 1 John Marino freebsd_committer freebsd_triage 2014-07-25 13:12:07 UTC
over to maintainer
Comment 2 Ashish SHUKLA freebsd_committer freebsd_triage 2014-07-25 21:57:54 UTC
(In reply to Robert Cina from comment #0)
> The port editors/emacs-devel fails to compile with a linker error on my
> 10.0-stable system.
> 
> The output of the linker error is shown below:
> 
> sr/local/lib -lXfixes   -L/usr/local/lib -lxml2     -lutil -lncurses 
> -lgio-2.0 -lgobject-2.0 -L/usr/local/lib -lglib-2.0 -lintl   -lgconf-2
> -L/usr/local/lib -lglib-2.0 -lintl   -lgobject-2.0 -L/usr/local/lib
> -lglib-2.0 -lintl    -L/usr/local/lib -lfreetype   -lfontconfig
> -L/usr/local/lib -lfreetype   -lz -lbz2 -lotf -L/usr/local/lib -lfreetype  
> -lm17n-flt -L/usr/local/lib -lm17n-core   -L/usr/local/lib -lgnutls   
> -lgio-2.0 -lgobject-2.0 -L/usr/local/lib -lglib-2.0 -lintl   -lm -lz
> /usr/bin/ld: warning: libbz2.so.4, needed by /usr/local/lib/libfreetype.so,
> may conflict with libbz2.so.1
> alloc.o: In function `Fmemory_info':
> alloc.c:(.text+0x6dad): undefined reference to `sysinfo'
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> gmake[3]: *** [temacs] Error 1
> gmake[3]: Leaving directory
> `/usr/ports/editors/emacs-devel/work/emacs-24.4.50.117564/src'
> gmake[2]: *** [src] Error 2
> gmake[2]: Leaving directory
> `/usr/ports/editors/emacs-devel/work/emacs-24.4.50.117564'
> *** Error code 1
> 
> Stop.
> make[1]: stopped in /usr/ports/editors/emacs-devel
> *** Error code 1
> 
> Stop.
> make: stopped in /usr/ports/editors/emacs-devel

This seems to come from src/alloc.c:

6876 DEFUN ("memory-info", Fmemory_info, Smemory_info, 0, 0, 0,
6877        doc: /* Return a list of (TOTAL-RAM FREE-RAM TOTAL-SWAP FREE-SWAP).
6878 All values are in Kbytes.  If there is no swap space,
6879 last two values are zero.  If the system is not supported
6880 or memory information can't be obtained, return nil.  */)
6881   (void)
6882 {
6883 #if defined HAVE_LINUX_SYSINFO
6884   struct sysinfo si;
6885   uintmax_t units;
6886 
6887   if (sysinfo (&si))

To figure out this, I'll need following information:

1. config.log
2. output of 'pkg info'

Thanks!
Comment 3 Robert Cina 2014-07-25 22:49:03 UTC
Created attachment 144983 [details]
config.log

Attached is the config.log as requested.
Comment 4 Robert Cina 2014-07-25 22:49:50 UTC
Created attachment 144984 [details]
pkg_info_output

This is the pkg info output as requested.
Comment 5 Robert Cina 2014-07-25 22:50:44 UTC
Attached is the information you requested.  Hopefully this will help you track down the issue. 

Thanks
Comment 6 Ashish SHUKLA freebsd_committer freebsd_triage 2014-07-25 23:09:08 UTC
(In reply to Robert Cina from comment #5)
> Attached is the information you requested.  Hopefully this will help you
> track down the issue. 
> 
> Thanks


configure:9674: checking for sys/sysinfo.h
configure:9674: cc -c -O2 -pipe -fno-strict-aliasing   -I/usr/local/include conftest.c >&5
configure:9674: $? = 0 
configure:9674: result: yes

So, it looks following port is the culprit which provides the header file in question.

libsysinfo-0.0.2_1             GNU libc's sysinfo port for FreeBSD

Could you please uninstall it, and see if it installs fine ?

If yes, then I probably have to workaround this in the port.

HTH
Comment 7 Robert Cina 2014-07-26 02:34:47 UTC
I uninstalled the port 

libsysinfo-0.0.2_1             GNU libc's sysinfo port for FreeBSD

from my machine and recompiled the emacs port again. And indeed that port was the culprit! The port compiled and installed fine on my machine without it being installed.  Thanks for the diligent work tracking down the culprit to that compiler error.
Comment 8 rezo 2018-02-24 08:43:55 UTC
*** Bug 226153 has been marked as a duplicate of this bug. ***