Bug 119016 - [patch] security/dirmngr does not build
Summary: [patch] security/dirmngr does not build
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: Michael Nottebrock
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-25 22:30 UTC by Jose G. Juanino
Modified: 2008-01-02 19:50 UTC (History)
0 users

See Also:


Attachments
file.diff (1.61 KB, patch)
2007-12-25 22:30 UTC, Jose G. Juanino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jose G. Juanino 2007-12-25 22:30:02 UTC
Building the last 1.0.1 security/dirmngr port I have got the following error (linking dirmngr executable):

./jnlib/libjnlib.a(utf8conv.o)(.text+0x689): In function `do_utf8_to_native':
: undefined reference to `libiconv_open'
./jnlib/libjnlib.a(utf8conv.o)(.text+0x6ee): In function `do_utf8_to_native':
: undefined reference to `libiconv'
./jnlib/libjnlib.a(utf8conv.o)(.text+0x70a): In function `do_utf8_to_native':
: undefined reference to `libiconv_close'
./jnlib/libjnlib.a(utf8conv.o)(.text+0x846): In function `native_to_utf8':
: undefined reference to `libiconv_open'
./jnlib/libjnlib.a(utf8conv.o)(.text+0x8c6): In function `native_to_utf8':
: undefined reference to `libiconv'
./jnlib/libjnlib.a(utf8conv.o)(.text+0x8db): In function `native_to_utf8':
: undefined reference to `libiconv_close'
./jnlib/libjnlib.a(utf8conv.o)(.text+0xc43): In function `set_native_charset':
: undefined reference to `libiconv_open'
./jnlib/libjnlib.a(utf8conv.o)(.text+0xc50): In function `set_native_charset':
: undefined reference to `libiconv_close'
./jnlib/libjnlib.a(utf8conv.o)(.text+0xc60): In function `set_native_charset':
: undefined reference to `libiconv_open'
./jnlib/libjnlib.a(utf8conv.o)(.text+0xc6d): In function `set_native_charset':
: undefined reference to `libiconv_close'
./jnlib/libjnlib.a(utf8conv.o)(.text+0x25): In function `jnlib_iconv_close':
: undefined reference to `libiconv_close'
./jnlib/libjnlib.a(utf8conv.o)(.text+0x35): In function `jnlib_iconv':
: undefined reference to `libiconv'
./jnlib/libjnlib.a(utf8conv.o)(.text+0x45): In function `jnlib_iconv_open':
: undefined reference to `libiconv_open'

The same ocurrs on 7.0-BETA4

Fix: Apply the attached patch and build again the port:

# cd /usr/ports/security/dirmngr
# patch -p1 < patch_dirmngr.txt
# make

Patch attached with submission follows:
How-To-Repeat: Build the last security/dirmngr port (version 1.0.1)
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-12-25 22:30:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lofi

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Michael Nottebrock freebsd_committer freebsd_triage 2007-12-26 17:19:04 UTC
Thanks for the report! Are you building with WITHOUT_NLS set?

Also, please attach the output of ls /var/db/pkg and the contents of
/usr/ports/security/dirmngr/work/dirmngr-1.0.1/config.log to this PR.
Comment 3 Jose G. Juanino 2007-12-26 21:06:40 UTC
El miércoles 26 de diciembre a las 18:19:04 CET, Michael Nottebrock escribió:
> Thanks for the report! Are you building with WITHOUT_NLS set?

Yes.

> Also, please attach the output of ls /var/db/pkg and the contents of
> /usr/ports/security/dirmngr/work/dirmngr-1.0.1/config.log to this PR.

http://www.telefonica.net/web2/gauss/pkglist.txt
http://www.telefonica.net/web2/gauss/config.log

Regards
Comment 4 Jose G. Juanino 2007-12-30 17:49:20 UTC
El miércoles 26 de diciembre a las 22:06:40 CET, José García Juanino escribió:
> El miércoles 26 de diciembre a las 18:19:04 CET, Michael Nottebrock escribió:
> > Thanks for the report! Are you building with WITHOUT_NLS set?
> 
> Yes.
> 
> > Also, please attach the output of ls /var/db/pkg and the contents of
> > /usr/ports/security/dirmngr/work/dirmngr-1.0.1/config.log to this PR.
> 
> http://www.telefonica.net/web2/gauss/pkglist.txt
> http://www.telefonica.net/web2/gauss/config.log

I have investigated this tricky problem, and my conclusion is that the
port is asumming that at least one of the security/libgcrypt,
security/libksbao or security/libgpg-error port is built without
WITHOUT_NLS knob. In my computer I have WITHOUT_NLS in make.conf, thus
I get the following:

# ldd /usr/local/lib/libgcrypt.so \
  /usr/local/lib/libksba.so \
  /usr/local/lib/libgpg-error.so 

/usr/local/lib/libgcrypt.so:
        libgpg-error.so.0 => /usr/local/lib/libgpg-error.so.0 (0x281c0000)
/usr/local/lib/libksba.so:
        libgpg-error.so.0 => /usr/local/lib/libgpg-error.so.0 (0x281a1000)
/usr/local/lib/libgpg-error.so:

As you can see, no libiconv.so.3 appears.

I you build some of those ports with WITHOUT_NLS=1, you will get as ldd
output something similar to:

/usr/local/lib/libgcrypt.so:
        libgpg-error.so.0 => /usr/local/lib/libgpg-error.so.0 (0x800b4f000)
        libc.so.7 => /lib/libc.so.7 (0x800633000)
        libintl.so.8 => /usr/local/lib/libintl.so.8 (0x800c52000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x800d5b000)
/usr/local/lib/libksba.so:
        libgpg-error.so.0 => /usr/local/lib/libgpg-error.so.0 (0x800b3b000)
        libc.so.7 => /lib/libc.so.7 (0x800633000)
        libintl.so.8 => /usr/local/lib/libintl.so.8 (0x800c3e000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x800d47000)
/usr/local/lib/libgpg-error.so:
        libintl.so.8 => /usr/local/lib/libintl.so.8 (0x800b03000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x800c0c000)
        libc.so.7 => /lib/libc.so.7 (0x800633000)


When dirmngr executable is linked, it only links with
/usr/local/lib/libgcrypt.so, /usr/local/lib/libksba.so and
/usr/local/lib/libgpg-error.so (not against /usr/local/lib/libiconv.so).
In my computer, none of them is dinamically linked with libiconv.so,
therefore it cannot find the libiconv simbols and the linker fails. The
exact command is:

cc -I../jnlib -I/usr/local/include  -I/usr/local/include
-I/usr/local/include -I/usr/local/include -I/usr/local/include
-I/usr/local/include/pth -O2 -fno-strict-aliasing -pipe -march=k8 -Wall
-Wno-pointer-sign  -L/usr/local/lib -L/usr/local/lib -o dirmngr
dirmngr.o server.o crlcache.o crlfetch.o certcache.o cdblib.o ldap.o
http.o misc.o ocsp.o estream.o estream-printf.o validate.o exechelp.o
get-path.o ../jnlib/libjnlib.a  -L/usr/local/lib -lassuan-pth
-L/usr/local/lib -lgcrypt -L/usr/local/lib -lgpg-error -L/usr/local/lib
-lksba -lgpg-error -L/usr/local/lib/pth -lpth

Please try the following in order to reproduce the problem:

# portupgrade -f -M WITHOUT_NLS=1 \
libgcrypt-1.2.4_1 \
libgpg-error-1.5 \
libksba-1.0.2 \
libgpg-error-1.5

# cd /usr/ports/security/dirmngr && make -DWITHOUT_NLS


I think we have only 2 solutions:

    1) Do not allow the WITHOUT_NLS knob in Makefile of dirmngr port.
    2) Commit my patch to ensure that libiconv.so is explicited linked,
       at least when WITHOUT_NLS is set.

Thank you very much for your patience, and excuse mi poor english.

Best regards
Comment 5 dfilter service freebsd_committer freebsd_triage 2008-01-02 19:40:42 UTC
lofi        2008-01-02 19:40:38 UTC

  FreeBSD ports repository

  Modified files:
    security/dirmngr     Makefile 
  Added files:
    security/dirmngr/files patch-src-Makefile.in 
  Log:
  Fix build in WITHOUT_NLS case.
  
  PR:             ports/119016
  Submitted by:   José García Juanino <jjuanino@gmail.com>
  
  Revision  Changes    Path
  1.31      +1 -0      ports/security/dirmngr/Makefile
  1.1       +27 -0     ports/security/dirmngr/files/patch-src-Makefile.in (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Michael Nottebrock freebsd_committer freebsd_triage 2008-01-02 19:41:11 UTC
State Changed
From-To: open->closed

Fixed, thanks for reporting!