fvwmorg / fvwm3

FVWM version 3 -- the successor to fvwm2
Other
505 stars 79 forks source link

FreeBSD system iconv- errors during linking #469

Open ghost opened 3 years ago

ghost commented 3 years ago

Thanks for reporting your bug here! The following template will help with giving as much information as possible so that it's easier to diagnose and fix.

Upfront Information

Please provide the following information by running the command and providing the output.

Does not apply as build fails.

fvwm source updated as of ...

commit ebe9655a (HEAD -> refs/heads/master, refs/remotes/origin/master, refs/remotes/origin/HEAD) Author: Thomas Adam thomas@fvwm.org Date: Mar.2021.0316-2305 +0000

Expected Behaviour

Build would actually succeed with system iconv on FreeBSD 12.

Actual Behaviour

configure warns that it finds both system iconv and externally in libiconv ...

... configure: WARNING: Both system iconv and libiconv found: use libiconv configure: WARNING: Use --with-iconv-library=no to use the system iconv ...

A build succeeds with externally installed libiconv. But fails when trying to build as suggested above during link time due to obviously missing symbols in system iconv(3) ...

... CCLD fvwm3 ld: error: undefined symbol: libiconv_open

referenced by Ficonv.c:236 Ficonv.o:(convert_charsets) in archive ../libs/libfvwm3.a ... ld: error: undefined symbol: libiconv referenced by Ficonv.c:278 Ficonv.o:(convert_charsets) in archive ../libs/libfvwm3.a ... ld: error: undefined symbol: libiconv_close referenced by Ficonv.c:340 Ficonv.o:(convert_charsets) in archive ../libs/libfvwm3.a ... cc: error: linker command failed with exit code 1 (use -v to see invocation) gmake[2]: *** [Makefile:572: fvwm3] Error 1 ...

... symbols actually available (from manual page of iconv(3)) are ...

LIBRARY Standard C Library (libc, -lc)

SYNOPSIS

include

    iconv_t
    iconv_open(const char *dstname, const char *srcname);

    int
    iconv_open_into(const char *dstname, const char *srcname,
        iconv_allocation_t *ptr);

    int
    iconv_close(iconv_t cd);

    size_t
    iconv(iconv_t cd, char ** restrict src, size_t * restrict srcleft,
        char ** restrict dst, size_t * restrict dstleft);

    size_t
    __iconv(iconv_t cd, char ** restrict src, size_t * restrict srcleft,
        char ** restrict dst, size_t * restrict dstleft, uint32_t flags,
        size_t * invalids);

...

Either adjust linking for FreeBSD iconv.

Or, insist only on external libiconv and do not suggest how to use system iconv on FreeBSD 12.

Steps to Reproduce

How can the problem be reproduced? For this, the following is helpful:

On recent FreeBSD 12, see build fail with system iconv as suggested by configure with "--with-iconv-library=no" option.

Extra Information

Attached is the configure+build log. make-fvwm3.2021-0321.freebsd-iconv-fail.txt

ThomasAdam commented 3 years ago

Hi @parv

Thanks. I cannot reproduce this problem at all. Is there any other steps I need to do to reproduce this?

ghost commented 3 years ago

(Where are my manners?) Hi @ThomasAdam,

I have added a cut down configure+make script which reliably fails. I am sorry for not providing this initially.

make-fvwm3-freebsd-iconv.sh.txt

ThomasAdam commented 3 years ago

Thanks, @parv

I see what's happening here. I'm going to switch fvwm3 to use gettext which will also sort out the iconv handling, as the AM_ICONV macro in configure.ac can be used (thus removing the same broken logic we currently use).

It'll take me a little bit of time, but for now you can at least build fvwm3 using libiconv. After this change, you'll be able to use both system and libiconv, and I'm keen to keep supporting both as well.

ghost commented 3 years ago

Thank you @ThomasAdam for looking into this. I will keep any eye on the issue to report back on successful build with system iconv.