Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD system iconv- errors during linking #469

Closed
ghost opened this issue Mar 22, 2021 · 5 comments
Closed

FreeBSD system iconv- errors during linking #469

ghost opened this issue Mar 22, 2021 · 5 comments
Labels
type:bug Something's broken!

Comments

@ghost
Copy link

ghost commented Mar 22, 2021

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.

  • Fvwm3 version (run: fvwm3 --version)

Does not apply as build fails.

fvwm source updated as of ...

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

  • Linux distribution or BSD name/version

    FreeBSD 12-STABLE (stable/12-n232872-af0cea80104)

  • Platform (run: uname -sp)

    FreeBSD amd64

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.h>

    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

@ghost ghost added the type:bug Something's broken! label Mar 22, 2021
@ThomasAdam
Copy link
Member

Hi @Parv

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

@ghost
Copy link
Author

ghost commented Mar 22, 2021

(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
Copy link
Member

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.

@ThomasAdam ThomasAdam added this to the 1.0.3 milestone Mar 28, 2021
@ghost
Copy link
Author

ghost commented Mar 29, 2021

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

@ThomasAdam ThomasAdam removed this from the 1.0.3 milestone Apr 17, 2021
@ThomasAdam ThomasAdam added this to the 1.0.4 milestone May 30, 2021
@ThomasAdam ThomasAdam reopened this May 30, 2021
@ThomasAdam ThomasAdam removed this from the 1.0.4 milestone Jul 8, 2021
@ThomasAdam ThomasAdam added this to the 1.0.5 milestone Jul 19, 2021
@ThomasAdam ThomasAdam moved this to To do in FVWM3 Sep 18, 2022
@ThomasAdam ThomasAdam added this to FVWM3 Sep 18, 2022
@ThomasAdam ThomasAdam removed this from the 1.0.5 milestone Sep 18, 2022
@ThomasAdam
Copy link
Member

I believe this fixed by the meson work in -git (what will be 1.1.1)

@github-project-automation github-project-automation bot moved this from To do to Done in FVWM3 Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something's broken!
Projects
Status: Done
Development

No branches or pull requests

1 participant