Skip to content

Demote --no-undefined-version to warning #61208

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

Closed
nikic opened this issue Mar 6, 2023 · 8 comments · Fixed by llvm/llvm-project-release-prs#347
Closed

Demote --no-undefined-version to warning #61208

nikic opened this issue Mar 6, 2023 · 8 comments · Fixed by llvm/llvm-project-release-prs#347

Comments

@nikic
Copy link
Contributor

nikic commented Mar 6, 2023

LLVM 16 enabled --no-undefined-version by default in https://reviews.llvm.org/D135402. This caused wide-spread breakage, including in LLVM itself.

We should consider demoting this to a warning, at least for the LLVM 16 release. This will make people aware that there is an issue, without breaking builds.

@nikic nikic added the lld label Mar 6, 2023
@nikic nikic added this to the LLVM 16.0.0 Release milestone Mar 6, 2023
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Mar 6, 2023
@nikic
Copy link
Contributor Author

nikic commented Mar 6, 2023

@MaskRay Any thoughts on this? Would it make sense to make this a warning first, before making it a hard error?

@MaskRay
Copy link
Member

MaskRay commented Mar 6, 2023

We should quantify "wide-spread breakage". As I know Gentoo sees issues from ~10 packages: gentoo/gentoo#29097 I have reported issues in their issue trackers or fixed the issue myself.

If the issue is using ld.lld with old versions of these packages, changing error to warn for just release/16.x is fine.
You can cherry pick https://github.com/MaskRay/llvm-project/tree/no-undefined-version into release/16.x.
There is no sufficient evidence to change the main branch decision, though.

@MaskRay MaskRay added lld:ELF and removed lld labels Mar 6, 2023
@llvmbot
Copy link
Member

llvmbot commented Mar 6, 2023

@llvm/issue-subscribers-lld-elf

@nikic
Copy link
Contributor Author

nikic commented Mar 6, 2023

/branch MaskRay/llvm-project/no-undefined-version

@llvmbot
Copy link
Member

llvmbot commented Mar 6, 2023

/pull-request llvm/llvm-project-release-prs#347

@nikic
Copy link
Contributor Author

nikic commented Mar 6, 2023

We should quantify "wide-spread breakage". As I know Gentoo sees issues from ~10 packages: gentoo/gentoo#29097 I have reported issues in their issue trackers or fixed the issue myself.

Also breaks Rust on two different levels.

If the issue is using ld.lld with old versions of these packages, changing error to warn for just release/16.x is fine. You can cherry pick https://github.com/MaskRay/llvm-project/tree/no-undefined-version into release/16.x. There is no sufficient evidence to change the main branch decision, though.

I think that's fine. The only problem is that this went directly to an error. If there is a warning cycle in between, it should be okay.

rrbutani added a commit to rrbutani/nixpkgs that referenced this issue May 8, 2024
---

As detailed in NixOS#299849, `pkgsLLVM.libxcrypt` fails to build.

At nixpkgs rev `3b61d595b17f2e3410bcc79c473060e098829eb8`:
```console
$ nix-instantiate . -A libxcrypt # gcc
/nix/store/finy8awd01kgg8p832m7mnm49qhm2225-libxcrypt-4.4.36.drv

$ nix-instantiate . -A pkgsLLVM.libxcrypt # LLVM 17
/nix/store/wybil0v9j55681w8vwz5751j6kfaccc9-libxcrypt-x86_64-unknown-linux-gnu-4.4.36.drv
```

This is the error we get when building the latter:
```console
libtool: link: x86_64-unknown-linux-gnu-clang -shared \
    -fPIC -DPIC \
        lib/.libs/libcrypt_la-alg-des-tables.o \
        lib/.libs/libcrypt_la-alg-des.o \
        lib/.libs/libcrypt_la-alg-gost3411-2012-core.o \
        lib/.libs/libcrypt_la-alg-gost3411-2012-hmac.o \
        lib/.libs/libcrypt_la-alg-hmac-sha1.o \
        lib/.libs/libcrypt_la-alg-md4.o \
        lib/.libs/libcrypt_la-alg-md5.o \
        lib/.libs/libcrypt_la-alg-sha1.o \
        lib/.libs/libcrypt_la-alg-sha256.o \
        lib/.libs/libcrypt_la-alg-sha512.o \
        lib/.libs/libcrypt_la-alg-yescrypt-common.o \
        lib/.libs/libcrypt_la-alg-yescrypt-opt.o \
        lib/.libs/libcrypt_la-crypt-bcrypt.o \
        lib/.libs/libcrypt_la-crypt-des.o \
        lib/.libs/libcrypt_la-crypt-gensalt-static.o \
        lib/.libs/libcrypt_la-crypt-gost-yescrypt.o \
        lib/.libs/libcrypt_la-crypt-md5.o \
        lib/.libs/libcrypt_la-crypt-nthash.o \
        lib/.libs/libcrypt_la-crypt-pbkdf1-sha1.o \
        lib/.libs/libcrypt_la-crypt-scrypt.o \
        lib/.libs/libcrypt_la-crypt-sha256.o \
        lib/.libs/libcrypt_la-crypt-sha512.o \
        lib/.libs/libcrypt_la-crypt-static.o \
        lib/.libs/libcrypt_la-crypt-sunmd5.o \
        lib/.libs/libcrypt_la-crypt-yescrypt.o \
        lib/.libs/libcrypt_la-crypt.o \
        lib/.libs/libcrypt_la-util-base64.o \
        lib/.libs/libcrypt_la-util-gensalt-sha.o \
        lib/.libs/libcrypt_la-util-get-random-bytes.o \
        lib/.libs/libcrypt_la-util-make-failure-token.o \
        lib/.libs/libcrypt_la-util-xbzero.o \
        lib/.libs/libcrypt_la-util-xstrcpy.o \
    -g -O2 \
    -Wl,--version-script -Wl,./libcrypt.map \
    -Wl,-z -Wl,defs \
    -Wl,-z -Wl,text \
    -Wl,-z -Wl,relro \
    -Wl,-z -Wl,now \
    -Wl,-soname -Wl,libcrypt.so.2 \
    -o .libs/libcrypt.so.2.0.0

x86_64-unknown-linux-gnu-ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'crypt_gensalt_r' failed: symbol not defined
x86_64-unknown-linux-gnu-ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt' failed: symbol not defined
x86_64-unknown-linux-gnu-ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt_gensalt' failed: symbol not defined
x86_64-unknown-linux-gnu-ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt_gensalt_r' failed: symbol not defined
x86_64-unknown-linux-gnu-ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt_r' failed: symbol not defined
```

Comparing the gcc build and the LLVM build:

Here's the link invocation for `libcrypt.so.2.0.0` w/gcc:
```console
libtool: link: gcc -shared \
    -fPIC -DPIC \
        lib/.libs/libcrypt_la-alg-des-tables.o \
        lib/.libs/libcrypt_la-alg-des.o \
        lib/.libs/libcrypt_la-alg-gost3411-2012-core.o \
        lib/.libs/libcrypt_la-alg-gost3411-2012-hmac.o \
        lib/.libs/libcrypt_la-alg-hmac-sha1.o \
        lib/.libs/libcrypt_la-alg-md4.o \
        lib/.libs/libcrypt_la-alg-md5.o \
        lib/.libs/libcrypt_la-alg-sha1.o \
        lib/.libs/libcrypt_la-alg-sha256.o \
        lib/.libs/libcrypt_la-alg-sha512.o \
        lib/.libs/libcrypt_la-alg-yescrypt-common.o \
        lib/.libs/libcrypt_la-alg-yescrypt-opt.o \
        lib/.libs/libcrypt_la-crypt-bcrypt.o \
        lib/.libs/libcrypt_la-crypt-des.o \
        lib/.libs/libcrypt_la-crypt-gensalt-static.o \
        lib/.libs/libcrypt_la-crypt-gost-yescrypt.o \
        lib/.libs/libcrypt_la-crypt-md5.o \
        lib/.libs/libcrypt_la-crypt-nthash.o \
        lib/.libs/libcrypt_la-crypt-pbkdf1-sha1.o \
        lib/.libs/libcrypt_la-crypt-scrypt.o \
        lib/.libs/libcrypt_la-crypt-sha256.o \
        lib/.libs/libcrypt_la-crypt-sha512.o \
        lib/.libs/libcrypt_la-crypt-static.o \
        lib/.libs/libcrypt_la-crypt-sunmd5.o \
        lib/.libs/libcrypt_la-crypt-yescrypt.o \
        lib/.libs/libcrypt_la-crypt.o \
        lib/.libs/libcrypt_la-util-base64.o \
        lib/.libs/libcrypt_la-util-gensalt-sha.o \
        lib/.libs/libcrypt_la-util-get-random-bytes.o \
        lib/.libs/libcrypt_la-util-make-failure-token.o \
        lib/.libs/libcrypt_la-util-xbzero.o \
        lib/.libs/libcrypt_la-util-xstrcpy.o \
    -g -O2 \
    -Wl,--version-script -Wl,./libcrypt.map \
    -Wl,-z -Wl,defs \
    -Wl,-z -Wl,text \
    -Wl,-z -Wl,relro \
    -Wl,-z -Wl,now \
    -Wl,-soname -Wl,libcrypt.so.2 \
    -o .libs/libcrypt.so.2.0.0
```

(i.e. they're identical, modulo the compiler name:
```diff
*** gcc-link-invocation 2024-05-07 07:17:46.034713173 -0700
--- clang-link-invocation       2024-05-07 07:19:38.030392378 -0700
***************
*** 1,3 ****
! libtool: link: gcc -shared \
      -fPIC -DPIC \
          lib/.libs/libcrypt_la-alg-des-tables.o \
--- 1,3 ----
! libtool: link: x86_64-unknown-linux-gnu-clang -shared \
      -fPIC -DPIC \
          lib/.libs/libcrypt_la-alg-des-tables.o \
```
)

`libcrypt.map` is also identical for the two builds:
```ld
/* Generated from libcrypt.map.in by gen-libcrypt-map.  DO NOT EDIT.  */
XCRYPT_2.0 {
  global:
    crypt;
    crypt_gensalt;
    crypt_gensalt_r;
    crypt_gensalt_ra;
    crypt_gensalt_rn;
    crypt_r;
    crypt_ra;
    crypt_rn;
    xcrypt;
    xcrypt_gensalt;
    xcrypt_gensalt_r;
    xcrypt_r;
  local:
    *;
};
XCRYPT_4.3 {
  global:
    crypt_checksalt;
} XCRYPT_2.0;
XCRYPT_4.4 {
  global:
    crypt_preferred_method;
} XCRYPT_4.3;
```

Comparing the defined exported symbols in the `.o` files linked in across the two builds:
```bash
objs=(
    alg-des-tables.o
    alg-des.o
    alg-gost3411-2012-core.o
    alg-gost3411-2012-hmac.o
    alg-hmac-sha1.o
    alg-md4.o
    alg-md5.o
    alg-sha1.o
    alg-sha256.o
    alg-sha512.o
    alg-yescrypt-common.o
    alg-yescrypt-opt.o
    crypt-bcrypt.o
    crypt-des.o
    crypt-gensalt-static.o
    crypt-gost-yescrypt.o
    crypt-md5.o
    crypt-nthash.o
    crypt-pbkdf1-sha1.o
    crypt-scrypt.o
    crypt-sha256.o
    crypt-sha512.o
    crypt-static.o
    crypt-sunmd5.o
    crypt-yescrypt.o
    crypt.o
    util-base64.o
    util-gensalt-sha.o
    util-get-random-bytes.o
    util-make-failure-token.o
    util-xbzero.o
    util-xstrcpy.o
)

for build_dir in gcc llvm; do
    for obj in ${objs[@]}; do
        o=$build_dir/lib/.libs/libcrypt_la-$obj
        nm -C --just-symbols --defined-only --extern-only $o
    done > ${build_dir}_syms.txt
done

diff {gcc,llvm}_syms.txt
```
... yields no differences.

Here's the full list:
```txt
_crypt_GOST34112012_Cleanup
_crypt_GOST34112012_Final
_crypt_GOST34112012_Init
_crypt_GOST34112012_Update
_crypt_gost_hash256
_crypt_gost_hmac256
_crypt_HMAC_SHA256_Buf
_crypt_HMAC_SHA256_Final
_crypt_HMAC_SHA256_Init
_crypt_HMAC_SHA256_Update
_crypt_PBKDF2_SHA256
_crypt_SHA256_Buf
_crypt_SHA256_Final
_crypt_SHA256_Init
_crypt_SHA256_Update
_crypt_SHA512_Buf
_crypt_SHA512_Final
_crypt_SHA512_Init
_crypt_SHA512_Update
_crypt_crypto_scrypt
_crypt_yescrypt
_crypt_yescrypt_decode64
_crypt_yescrypt_encode64
_crypt_yescrypt_encode_params
_crypt_yescrypt_encode_params_r
_crypt_yescrypt_r
_crypt_yescrypt_reencrypt
_crypt_yescrypt_digest_shared
_crypt_yescrypt_free_local
_crypt_yescrypt_free_shared
_crypt_yescrypt_init_local
_crypt_yescrypt_init_shared
_crypt_yescrypt_kdf
_crypt_crypt_bcrypt_a_rn
_crypt_crypt_bcrypt_rn
_crypt_crypt_bcrypt_y_rn
_crypt_gensalt_bcrypt_a_rn
_crypt_gensalt_bcrypt_rn
_crypt_gensalt_bcrypt_y_rn
_crypt_crypt_gensalt
crypt_gensalt@@XCRYPT_2.0
_crypt_crypt_gost_yescrypt_rn
_crypt_gensalt_gost_yescrypt_rn
_crypt_crypt_scrypt_rn
_crypt_gensalt_scrypt_rn
_crypt_crypt_sha512crypt_rn
_crypt_gensalt_sha512crypt_rn
_crypt_crypt
crypt@@XCRYPT_2.0
_crypt_crypt_yescrypt_rn
_crypt_gensalt_yescrypt_rn
crypt_checksalt@@XCRYPT_4.3
_crypt_crypt_checksalt
_crypt_crypt_gensalt_ra
_crypt_crypt_gensalt_rn
_crypt_crypt_preferred_method
_crypt_crypt_r
_crypt_crypt_ra
_crypt_crypt_rn
crypt_gensalt_ra@@XCRYPT_2.0
crypt_gensalt_rn@@XCRYPT_2.0
crypt_preferred_method@@XCRYPT_4.4
crypt_ra@@XCRYPT_2.0
crypt_rn@@XCRYPT_2.0
crypt_r@@XCRYPT_2.0
_crypt_ascii64
_crypt_gensalt_sha_rn
_crypt_get_random_bytes
_crypt_make_failure_token
_crypt_strcpy_or_abort
```

All of the symbols `lld` was complaining about actually are missing:
```
crypt_gensalt_r
xcrypt
xcrypt_gensalt
xcrypt_gensalt_r
xcrypt_r
```

---

Poking around a bit reveals that this is really a regression caused by the
[`llvmPackages` 16 -> 17 bump on Linux](NixOS#285333);
digging a little further reveals that this is ultimately caused by a
change in `lld`:

```console
// in the nix repl
> np = import ./. {}

// use gcc w/lld 16:
> okay = np.libxcrypt.override { stdenv = np.stdenv.override (o: { allowedRequisites = null; cc = o.cc.override { bintools = np.llvmPackages_16.bintools; }; }); }
> okay
«derivation /nix/store/mdpaggjkjiw7v2qzw8g4xaf9vfw3z28d-libxcrypt-4.4.36.drv»

> :b okay # builds fine, modulo some silliness with flags

// use gcc w/lld *17*:
> bad = np.libxcrypt.override { stdenv = np.stdenv.override (o: { allowedRequisites = null; cc = o.cc.override { bintools = np.llvmPackages_17.bintools; }; }); }
> bad
«derivation /nix/store/66bjyyapykl6mbmai7qbn7vwm762bdsc-libxcrypt-4.4.36.drv»

> :b bad # yields the version script linker error
```

Note that with the `gcc` + `lld` 16 build above we get the following
output as part of the build:
```
ld: warning: version script assignment of 'XCRYPT_2.0' to symbol 'crypt_gensalt_r' failed: symbol not defined
ld: warning: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt' failed: symbol not defined
ld: warning: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt_gensalt' failed: symbol not defined
ld: warning: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt_gensalt_r' failed: symbol not defined
ld: warning: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt_r' failed: symbol not defined
```

This is because in 16 `--no-undefined-version` is enabled by default:
  - [commit](llvm/llvm-project@241dbd3)
  - [phabricator](https://reviews.llvm.org/D135402)

Errors were ultimately demoted to warnings for the LLVM 16 release:
  - [issue](llvm/llvm-project#61208)
  - [PR](llvm/llvm-project-release-prs#347)
  - [commit](llvm/llvm-project@c1949c6)

As a workaround, this PR adds in `--undefined-version` as a linker flag
when building `libxcrypt` with `lld` 17 and newer.

Ultimately, the "right" solution is probably for upstream to update
`libcrypt.map` to not reference these symbols when they're not present
in `libcrypt.so`; see: besser82/libxcrypt#181

---

Closes NixOS#299849.
rrbutani added a commit to rrbutani/nixpkgs that referenced this issue May 24, 2024
Another fix like NixOS#309884 for fallout from `lld` 17's
`--no-undefined-version` default + hard error.

For context:
  - llvm/llvm-project@241dbd3
  - https://reviews.llvm.org/D135402
  - llvm/llvm-project#61208

Error (without this fix):

```console
ncurses> x86_64-unknown-linux-gnu-clang  -Qunused-arguments -Wno-error=implicit-function-declaration  -shared -Wl,--version-script,resulting.map -Wl,-soname,`basename ../lib/libncursesw.so.6.4 .6.4`.6,-stats,-lc -o ../lib/libncursesw.so.6.4 ../obj_s/hardscroll.o ../obj_s/hashmap.o ../obj_s/lib_addch.o ../obj_s/lib_addstr.o ../obj_s/lib_beep.o ../obj_s/lib_bkgd.o ../obj_s/lib_box.o ../obj_s/lib_chgat.o ../obj_s/lib_clear.o ../obj_s/lib_clearok.o ../obj_s/lib_clrbot.o ../obj_s/lib_clreol.o ../obj_s/lib_color.o ../obj_s/lib_colorset.o ../obj_s/lib_delch.o ../obj_s/lib_delwin.o ../obj_s/lib_echo.o ../obj_s/lib_endwin.o ../obj_s/lib_erase.o ../obj_s/lib_flash.o ../obj_s/lib_gen.o ../obj_s/lib_getch.o ../obj_s/lib_getstr.o ../obj_s/lib_hline.o ../obj_s/lib_immedok.o ../obj_s/lib_inchstr.o ../obj_s/lib_initscr.o ../obj_s/lib_insch.o ../obj_s/lib_insdel.o ../obj_s/lib_insnstr.o ../obj_s/lib_instr.o ../obj_s/lib_isendwin.o ../obj_s/lib_leaveok.o ../obj_s/lib_mouse.o ../obj_s/lib_move.o ../obj_s/lib_mvcur.o ../obj_s/lib_mvwin.o ../obj_s/lib_newterm.o ../obj_s/lib_newwin.o ../obj_s/lib_nl.o ../obj_s/lib_overlay.o ../obj_s/lib_pad.o ../obj_s/lib_printw.o ../obj_s/lib_redrawln.o ../obj_s/lib_refresh.o ../obj_s/lib_restart.o ../obj_s/lib_scanw.o ../obj_s/lib_screen.o ../obj_s/lib_scroll.o ../obj_s/lib_scrollok.o ../obj_s/lib_scrreg.o ../obj_s/lib_set_term.o ../obj_s/lib_slk.o ../obj_s/lib_slkatr_set.o ../obj_s/lib_slkatrof.o ../obj_s/lib_slkatron.o ../obj_s/lib_slkatrset.o ../obj_s/lib_slkattr.o ../obj_s/lib_slkclear.o ../obj_s/lib_slkcolor.o ../obj_s/lib_slkinit.o ../obj_s/lib_slklab.o ../obj_s/lib_slkrefr.o ../obj_s/lib_slkset.o ../obj_s/lib_slktouch.o ../obj_s/lib_touch.o ../obj_s/lib_tstp.o ../obj_s/lib_ungetch.o ../obj_s/lib_vidattr.o ../obj_s/lib_vline.o ../obj_s/lib_wattroff.o ../obj_s/lib_wattron.o ../obj_s/lib_winch.o ../obj_s/lib_window.o ../obj_s/nc_panel.o ../obj_s/safe_sprintf.o ../obj_s/tty_update.o ../obj_s/varargs.o ../obj_s/vsscanf.o ../obj_s/lib_freeall.o ../obj_s/charable.o ../obj_s/lib_add_wch.o ../obj_s/lib_box_set.o ../obj_s/lib_cchar.o ../obj_s/lib_erasewchar.o ../obj_s/lib_get_wch.o ../obj_s/lib_get_wstr.o ../obj_s/lib_hline_set.o ../obj_s/lib_in_wch.o ../obj_s/lib_in_wchnstr.o ../obj_s/lib_ins_wch.o ../obj_s/lib_inwstr.o ../obj_s/lib_key_name.o ../obj_s/lib_pecho_wchar.o ../obj_s/lib_slk_wset.o ../obj_s/lib_unget_wch.o ../obj_s/lib_vid_attr.o ../obj_s/lib_vline_set.o ../obj_s/lib_wacs.o ../obj_s/lib_wunctrl.o ../obj_s/expanded.o ../obj_s/legacy_coding.o ../obj_s/lib_dft_fgbg.o ../obj_s/lib_print.o ../obj_s/new_pair.o ../obj_s/resizeterm.o ../obj_s/use_screen.o ../obj_s/use_window.o ../obj_s/wresize.o ../obj_s/access.o ../obj_s/add_tries.o ../obj_s/alloc_ttype.o ../obj_s/codes.o ../obj_s/comp_captab.o ../obj_s/comp_error.o ../obj_s/comp_hash.o ../obj_s/comp_userdefs.o ../obj_s/db_iterator.o ../obj_s/doalloc.o ../obj_s/entries.o ../obj_s/fallback.o ../obj_s/free_ttype.o ../obj_s/getenv_num.o ../obj_s/home_terminfo.o ../obj_s/init_keytry.o ../obj_s/lib_acs.o ../obj_s/lib_baudrate.o ../obj_s/lib_cur_term.o ../obj_s/lib_data.o ../obj_s/lib_has_cap.o ../obj_s/lib_kernel.o ../obj_s/lib_keyname.o ../obj_s/lib_longname.o ../obj_s/lib_napms.o ../obj_s/lib_options.o ../obj_s/lib_raw.o ../obj_s/lib_setup.o ../obj_s/lib_termcap.o ../obj_s/lib_termname.o ../obj_s/lib_tgoto.o ../obj_s/lib_ti.o ../obj_s/lib_tparm.o ../obj_s/lib_tputs.o ../obj_s/lib_trace.o ../obj_s/lib_ttyflags.o ../obj_s/lib_twait.o ../obj_s/name_match.o ../obj_s/names.o ../obj_s/obsolete.o ../obj_s/read_entry.o ../obj_s/read_termcap.o ../obj_s/strings.o ../obj_s/tries.o ../obj_s/trim_sgr0.o ../obj_s/unctrl.o ../obj_s/visbuf.o ../obj_s/alloc_entry.o ../obj_s/captoinfo.o ../obj_s/comp_expand.o ../obj_s/comp_parse.o ../obj_s/comp_scan.o ../obj_s/parse_entry.o ../obj_s/write_entry.o ../obj_s/define_key.o ../obj_s/hashed_db.o ../obj_s/key_defined.o ../obj_s/keybound.o ../obj_s/keyok.o ../obj_s/version.o -L../lib
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.0.19991023' to symbol '_nc_check_termtype' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.0.19991023' to symbol '_nc_resolve_uses' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.5.20051010' to symbol '_nc_alloc_entry_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.5.20051010' to symbol '_nc_captoinfo_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.5.20051010' to symbol '_nc_comp_scan_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.7.20081102' to symbol '_nc_free_tic' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_comp_captab_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_leaks_tic' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol '_nc_info_hash_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol '_nc_trace_buf' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol '_tracechar' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol 'trace' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_cap_hash_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_capalias_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_infoalias_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_key_names' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_read_termcap_entry' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_trace_tries' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_tracebits' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.1.20000708' to symbol '_nc_utf8_outch' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
```

Co-authored-by: Bernardo Meurer <[email protected]>
github-actions bot pushed a commit to NixOS/nixpkgs that referenced this issue May 24, 2024
Another fix like #309884 for fallout from `lld` 17's
`--no-undefined-version` default + hard error.

For context:
  - llvm/llvm-project@241dbd3
  - https://reviews.llvm.org/D135402
  - llvm/llvm-project#61208

Error (without this fix):

```console
ncurses> x86_64-unknown-linux-gnu-clang  -Qunused-arguments -Wno-error=implicit-function-declaration  -shared -Wl,--version-script,resulting.map -Wl,-soname,`basename ../lib/libncursesw.so.6.4 .6.4`.6,-stats,-lc -o ../lib/libncursesw.so.6.4 ../obj_s/hardscroll.o ../obj_s/hashmap.o ../obj_s/lib_addch.o ../obj_s/lib_addstr.o ../obj_s/lib_beep.o ../obj_s/lib_bkgd.o ../obj_s/lib_box.o ../obj_s/lib_chgat.o ../obj_s/lib_clear.o ../obj_s/lib_clearok.o ../obj_s/lib_clrbot.o ../obj_s/lib_clreol.o ../obj_s/lib_color.o ../obj_s/lib_colorset.o ../obj_s/lib_delch.o ../obj_s/lib_delwin.o ../obj_s/lib_echo.o ../obj_s/lib_endwin.o ../obj_s/lib_erase.o ../obj_s/lib_flash.o ../obj_s/lib_gen.o ../obj_s/lib_getch.o ../obj_s/lib_getstr.o ../obj_s/lib_hline.o ../obj_s/lib_immedok.o ../obj_s/lib_inchstr.o ../obj_s/lib_initscr.o ../obj_s/lib_insch.o ../obj_s/lib_insdel.o ../obj_s/lib_insnstr.o ../obj_s/lib_instr.o ../obj_s/lib_isendwin.o ../obj_s/lib_leaveok.o ../obj_s/lib_mouse.o ../obj_s/lib_move.o ../obj_s/lib_mvcur.o ../obj_s/lib_mvwin.o ../obj_s/lib_newterm.o ../obj_s/lib_newwin.o ../obj_s/lib_nl.o ../obj_s/lib_overlay.o ../obj_s/lib_pad.o ../obj_s/lib_printw.o ../obj_s/lib_redrawln.o ../obj_s/lib_refresh.o ../obj_s/lib_restart.o ../obj_s/lib_scanw.o ../obj_s/lib_screen.o ../obj_s/lib_scroll.o ../obj_s/lib_scrollok.o ../obj_s/lib_scrreg.o ../obj_s/lib_set_term.o ../obj_s/lib_slk.o ../obj_s/lib_slkatr_set.o ../obj_s/lib_slkatrof.o ../obj_s/lib_slkatron.o ../obj_s/lib_slkatrset.o ../obj_s/lib_slkattr.o ../obj_s/lib_slkclear.o ../obj_s/lib_slkcolor.o ../obj_s/lib_slkinit.o ../obj_s/lib_slklab.o ../obj_s/lib_slkrefr.o ../obj_s/lib_slkset.o ../obj_s/lib_slktouch.o ../obj_s/lib_touch.o ../obj_s/lib_tstp.o ../obj_s/lib_ungetch.o ../obj_s/lib_vidattr.o ../obj_s/lib_vline.o ../obj_s/lib_wattroff.o ../obj_s/lib_wattron.o ../obj_s/lib_winch.o ../obj_s/lib_window.o ../obj_s/nc_panel.o ../obj_s/safe_sprintf.o ../obj_s/tty_update.o ../obj_s/varargs.o ../obj_s/vsscanf.o ../obj_s/lib_freeall.o ../obj_s/charable.o ../obj_s/lib_add_wch.o ../obj_s/lib_box_set.o ../obj_s/lib_cchar.o ../obj_s/lib_erasewchar.o ../obj_s/lib_get_wch.o ../obj_s/lib_get_wstr.o ../obj_s/lib_hline_set.o ../obj_s/lib_in_wch.o ../obj_s/lib_in_wchnstr.o ../obj_s/lib_ins_wch.o ../obj_s/lib_inwstr.o ../obj_s/lib_key_name.o ../obj_s/lib_pecho_wchar.o ../obj_s/lib_slk_wset.o ../obj_s/lib_unget_wch.o ../obj_s/lib_vid_attr.o ../obj_s/lib_vline_set.o ../obj_s/lib_wacs.o ../obj_s/lib_wunctrl.o ../obj_s/expanded.o ../obj_s/legacy_coding.o ../obj_s/lib_dft_fgbg.o ../obj_s/lib_print.o ../obj_s/new_pair.o ../obj_s/resizeterm.o ../obj_s/use_screen.o ../obj_s/use_window.o ../obj_s/wresize.o ../obj_s/access.o ../obj_s/add_tries.o ../obj_s/alloc_ttype.o ../obj_s/codes.o ../obj_s/comp_captab.o ../obj_s/comp_error.o ../obj_s/comp_hash.o ../obj_s/comp_userdefs.o ../obj_s/db_iterator.o ../obj_s/doalloc.o ../obj_s/entries.o ../obj_s/fallback.o ../obj_s/free_ttype.o ../obj_s/getenv_num.o ../obj_s/home_terminfo.o ../obj_s/init_keytry.o ../obj_s/lib_acs.o ../obj_s/lib_baudrate.o ../obj_s/lib_cur_term.o ../obj_s/lib_data.o ../obj_s/lib_has_cap.o ../obj_s/lib_kernel.o ../obj_s/lib_keyname.o ../obj_s/lib_longname.o ../obj_s/lib_napms.o ../obj_s/lib_options.o ../obj_s/lib_raw.o ../obj_s/lib_setup.o ../obj_s/lib_termcap.o ../obj_s/lib_termname.o ../obj_s/lib_tgoto.o ../obj_s/lib_ti.o ../obj_s/lib_tparm.o ../obj_s/lib_tputs.o ../obj_s/lib_trace.o ../obj_s/lib_ttyflags.o ../obj_s/lib_twait.o ../obj_s/name_match.o ../obj_s/names.o ../obj_s/obsolete.o ../obj_s/read_entry.o ../obj_s/read_termcap.o ../obj_s/strings.o ../obj_s/tries.o ../obj_s/trim_sgr0.o ../obj_s/unctrl.o ../obj_s/visbuf.o ../obj_s/alloc_entry.o ../obj_s/captoinfo.o ../obj_s/comp_expand.o ../obj_s/comp_parse.o ../obj_s/comp_scan.o ../obj_s/parse_entry.o ../obj_s/write_entry.o ../obj_s/define_key.o ../obj_s/hashed_db.o ../obj_s/key_defined.o ../obj_s/keybound.o ../obj_s/keyok.o ../obj_s/version.o -L../lib
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.0.19991023' to symbol '_nc_check_termtype' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.0.19991023' to symbol '_nc_resolve_uses' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.5.20051010' to symbol '_nc_alloc_entry_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.5.20051010' to symbol '_nc_captoinfo_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.5.20051010' to symbol '_nc_comp_scan_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.7.20081102' to symbol '_nc_free_tic' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_comp_captab_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_leaks_tic' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol '_nc_info_hash_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol '_nc_trace_buf' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol '_tracechar' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol 'trace' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_cap_hash_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_capalias_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_infoalias_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_key_names' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_read_termcap_entry' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_trace_tries' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_tracebits' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.1.20000708' to symbol '_nc_utf8_outch' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
```

Co-authored-by: Bernardo Meurer <[email protected]>
(cherry picked from commit 6080bfb)
Sobte pushed a commit to Sobte/nixpkgs that referenced this issue May 28, 2024
Another fix like NixOS#309884 for fallout from `lld` 17's
`--no-undefined-version` default + hard error.

For context:
  - llvm/llvm-project@241dbd3
  - https://reviews.llvm.org/D135402
  - llvm/llvm-project#61208

Error (without this fix):

```console
ncurses> x86_64-unknown-linux-gnu-clang  -Qunused-arguments -Wno-error=implicit-function-declaration  -shared -Wl,--version-script,resulting.map -Wl,-soname,`basename ../lib/libncursesw.so.6.4 .6.4`.6,-stats,-lc -o ../lib/libncursesw.so.6.4 ../obj_s/hardscroll.o ../obj_s/hashmap.o ../obj_s/lib_addch.o ../obj_s/lib_addstr.o ../obj_s/lib_beep.o ../obj_s/lib_bkgd.o ../obj_s/lib_box.o ../obj_s/lib_chgat.o ../obj_s/lib_clear.o ../obj_s/lib_clearok.o ../obj_s/lib_clrbot.o ../obj_s/lib_clreol.o ../obj_s/lib_color.o ../obj_s/lib_colorset.o ../obj_s/lib_delch.o ../obj_s/lib_delwin.o ../obj_s/lib_echo.o ../obj_s/lib_endwin.o ../obj_s/lib_erase.o ../obj_s/lib_flash.o ../obj_s/lib_gen.o ../obj_s/lib_getch.o ../obj_s/lib_getstr.o ../obj_s/lib_hline.o ../obj_s/lib_immedok.o ../obj_s/lib_inchstr.o ../obj_s/lib_initscr.o ../obj_s/lib_insch.o ../obj_s/lib_insdel.o ../obj_s/lib_insnstr.o ../obj_s/lib_instr.o ../obj_s/lib_isendwin.o ../obj_s/lib_leaveok.o ../obj_s/lib_mouse.o ../obj_s/lib_move.o ../obj_s/lib_mvcur.o ../obj_s/lib_mvwin.o ../obj_s/lib_newterm.o ../obj_s/lib_newwin.o ../obj_s/lib_nl.o ../obj_s/lib_overlay.o ../obj_s/lib_pad.o ../obj_s/lib_printw.o ../obj_s/lib_redrawln.o ../obj_s/lib_refresh.o ../obj_s/lib_restart.o ../obj_s/lib_scanw.o ../obj_s/lib_screen.o ../obj_s/lib_scroll.o ../obj_s/lib_scrollok.o ../obj_s/lib_scrreg.o ../obj_s/lib_set_term.o ../obj_s/lib_slk.o ../obj_s/lib_slkatr_set.o ../obj_s/lib_slkatrof.o ../obj_s/lib_slkatron.o ../obj_s/lib_slkatrset.o ../obj_s/lib_slkattr.o ../obj_s/lib_slkclear.o ../obj_s/lib_slkcolor.o ../obj_s/lib_slkinit.o ../obj_s/lib_slklab.o ../obj_s/lib_slkrefr.o ../obj_s/lib_slkset.o ../obj_s/lib_slktouch.o ../obj_s/lib_touch.o ../obj_s/lib_tstp.o ../obj_s/lib_ungetch.o ../obj_s/lib_vidattr.o ../obj_s/lib_vline.o ../obj_s/lib_wattroff.o ../obj_s/lib_wattron.o ../obj_s/lib_winch.o ../obj_s/lib_window.o ../obj_s/nc_panel.o ../obj_s/safe_sprintf.o ../obj_s/tty_update.o ../obj_s/varargs.o ../obj_s/vsscanf.o ../obj_s/lib_freeall.o ../obj_s/charable.o ../obj_s/lib_add_wch.o ../obj_s/lib_box_set.o ../obj_s/lib_cchar.o ../obj_s/lib_erasewchar.o ../obj_s/lib_get_wch.o ../obj_s/lib_get_wstr.o ../obj_s/lib_hline_set.o ../obj_s/lib_in_wch.o ../obj_s/lib_in_wchnstr.o ../obj_s/lib_ins_wch.o ../obj_s/lib_inwstr.o ../obj_s/lib_key_name.o ../obj_s/lib_pecho_wchar.o ../obj_s/lib_slk_wset.o ../obj_s/lib_unget_wch.o ../obj_s/lib_vid_attr.o ../obj_s/lib_vline_set.o ../obj_s/lib_wacs.o ../obj_s/lib_wunctrl.o ../obj_s/expanded.o ../obj_s/legacy_coding.o ../obj_s/lib_dft_fgbg.o ../obj_s/lib_print.o ../obj_s/new_pair.o ../obj_s/resizeterm.o ../obj_s/use_screen.o ../obj_s/use_window.o ../obj_s/wresize.o ../obj_s/access.o ../obj_s/add_tries.o ../obj_s/alloc_ttype.o ../obj_s/codes.o ../obj_s/comp_captab.o ../obj_s/comp_error.o ../obj_s/comp_hash.o ../obj_s/comp_userdefs.o ../obj_s/db_iterator.o ../obj_s/doalloc.o ../obj_s/entries.o ../obj_s/fallback.o ../obj_s/free_ttype.o ../obj_s/getenv_num.o ../obj_s/home_terminfo.o ../obj_s/init_keytry.o ../obj_s/lib_acs.o ../obj_s/lib_baudrate.o ../obj_s/lib_cur_term.o ../obj_s/lib_data.o ../obj_s/lib_has_cap.o ../obj_s/lib_kernel.o ../obj_s/lib_keyname.o ../obj_s/lib_longname.o ../obj_s/lib_napms.o ../obj_s/lib_options.o ../obj_s/lib_raw.o ../obj_s/lib_setup.o ../obj_s/lib_termcap.o ../obj_s/lib_termname.o ../obj_s/lib_tgoto.o ../obj_s/lib_ti.o ../obj_s/lib_tparm.o ../obj_s/lib_tputs.o ../obj_s/lib_trace.o ../obj_s/lib_ttyflags.o ../obj_s/lib_twait.o ../obj_s/name_match.o ../obj_s/names.o ../obj_s/obsolete.o ../obj_s/read_entry.o ../obj_s/read_termcap.o ../obj_s/strings.o ../obj_s/tries.o ../obj_s/trim_sgr0.o ../obj_s/unctrl.o ../obj_s/visbuf.o ../obj_s/alloc_entry.o ../obj_s/captoinfo.o ../obj_s/comp_expand.o ../obj_s/comp_parse.o ../obj_s/comp_scan.o ../obj_s/parse_entry.o ../obj_s/write_entry.o ../obj_s/define_key.o ../obj_s/hashed_db.o ../obj_s/key_defined.o ../obj_s/keybound.o ../obj_s/keyok.o ../obj_s/version.o -L../lib
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.0.19991023' to symbol '_nc_check_termtype' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.0.19991023' to symbol '_nc_resolve_uses' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.5.20051010' to symbol '_nc_alloc_entry_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.5.20051010' to symbol '_nc_captoinfo_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.5.20051010' to symbol '_nc_comp_scan_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TIC_5.7.20081102' to symbol '_nc_free_tic' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_comp_captab_leaks' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_leaks_tic' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol '_nc_info_hash_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol '_nc_trace_buf' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol '_tracechar' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.0.19991023' to symbol 'trace' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_cap_hash_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_capalias_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_infoalias_table' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_key_names' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_read_termcap_entry' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_trace_tries' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'local' to symbol '_nc_tracebits' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: version script assignment of 'NCURSES6_TINFO_5.1.20000708' to symbol '_nc_utf8_outch' failed: symbol not defined
ncurses> x86_64-unknown-linux-gnu-ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
```

Co-authored-by: Bernardo Meurer <[email protected]>
@haampie
Copy link
Contributor

haampie commented Jul 2, 2024

@MaskRay how are packages that conditionally export certain symbols supposed to deal with this nicely?

Typically version.map is declarative and defined ahead of time, and maybe it refers to symbols that are only added conditionally based on some configure script.

A generated version.map does not feel right, the declarative way is easier to manage.

Setting -Wl,--undefined-version feels too global.

@MaskRay
Copy link
Member

MaskRay commented Jul 2, 2024

@MaskRay how are packages that conditionally export certain symbols supposed to deal with this nicely?

Typically version.map is declarative and defined ahead of time, and maybe it refers to symbols that are only added conditionally based on some configure script.

A generated version.map does not feel right, the declarative way is easier to manage.

Setting -Wl,--undefined-version feels too global.

@haampie
If different configurations in a project lead to different sets of defined versioned symbols, consider preprocessing a template that generates the version script like the following:

v1 {
  x;
#ifdef Y
  x;
#endif
#ifdef Z
  z;
#endif
};

If it doesn't want to deal with the complexity, specify -Wl,--undefined-version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants