Skip to content

find_library linkable check is too strict for RTEMS #15601

Description

@rohel01

Describe the bug
In an existing repo where build was working, upgrading to meson 1.10 breaks meson setup

-----------
Command line: `/home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/riscv-rtems5-gcc -I/home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/include -I/home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/include-fixed -I/home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/../../../../riscv-rtems5/include -I/home/michael/sdk/rtems-noel-1.0.4/2022.06/riscv-rtems5/noel32imafd/lib/include/ -I/home/michael/sdk/rtems-noel-1.0.4/2022.06/kernel/riscv-rtems5/noel32imafd/lib/include/ /home/michael/proj/pfgen/endurance-flight-software/cmake/build/meson-private/tmpxn87jx67/testfile.c -o /home/michael/proj/pfgen/endurance-flight-software/cmake/build/meson-private/tmpxn87jx67/output.exe -B/home/michael/sdk/rtems-noel-1.0.4/2022.06/riscv-rtems5/noel32imafd/lib -B/home/michael/sdk/rtems-noel-1.0.4/2022.06/kernel/riscv-rtems5/noel32imafd/lib -Wall -Wextra -fno-common -ffunction-sections -fdata-sections -D_RTEMS_5_ -U_FILE_OFFSET_BITS -qrtems -Wfatal-errors -Werror=int-conversion -Werror=format -Werror=format-nonliteral -Werror=format-signedness -Werror=nonnull -Werror=implicit -Werror=implicit-fallthrough -Werror=missing-braces -Werror=incompatible-pointer-types -Werror=overflow -D_FILE_OFFSET_BITS=64 -O0 -Wl,--start-group /home/michael/proj/pfgen/endurance-flight-software/cmake/karvel/modules/karvel_endurance/lib/libkarvel_endurance.a -Wl,--allow-shlib-undefined /home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/crti.o /home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/crtbegin.o -nostdlib -nodefaultlibs -lrtemscpu -lrtemsbsp -lgcc -lc -Wl,--end-group -Wl,--gc-sections /home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/crtend.o /home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/crtn.o -T/home/michael/sdk/rtems-noel-1.0.4/2022.06/kernel/riscv-rtems5/noel32imafd/lib/linkcmds` -> 1
stderr:
/home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/../../../../riscv-rtems5/bin/ld: /home/michael/sdk/rtems-noel-1.0.4/2022.06/kernel/riscv-rtems5/noel32imafd/lib/start.o: in function `.L0 ':
/home/jernej/repositories/rsb/build-toolchain/src/bsp/riscv-rtems5/c/noel32imafd/lib/libbsp/riscv/riscv/../../../../../../../../rtems-noel-1.0.4/c/src/lib/libbsp/riscv/riscv/../../../../../../bsps/riscv/shared/start/start.S:77: undefined reference to `_ISR_Stack_area_end'
/home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/../../../../riscv-rtems5/bin/ld: /home/michael/sdk/rtems-noel-1.0.4/2022.06/kernel/riscv-rtems5/noel32imafd/lib/librtemscpu.a(userextiterate.o): in function `_User_extensions_Iterate':
/home/jernej/repositories/rsb/build-toolchain/src/bsp/riscv-rtems5/c/noel32imafd/cpukit/../../../../../rtems-noel-1.0.4/c/src/../../cpukit/score/src/userextiterate.c:167: undefined reference to `_User_extensions_Initial_count'

[...]

/home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/../../../../riscv-rtems5/bin/ld: /home/michael/sdk/rtems-noel-1.0.4/2022.06/kernel/riscv-rtems5/noel32imafd/lib/librtemscpu.a(ftruncate.o): in function `rtems_libio_iop':
/home/jernej/repositories/rsb/build-toolchain/src/rtems-noel-1.0.4/cpukit/include/rtems/libio_.h:130: undefined reference to `rtems_libio_iops'
/home/michael/sdk/rtems-noel-1.0.4/2022.06/bin/../lib/gcc/riscv-rtems5/9.3.0/../../../../riscv-rtems5/bin/ld: /home/jernej/repositories/rsb/build-toolchain/src/rtems-noel-1.0.4/cpukit/include/rtems/libio_.h:130: undefined reference to `rtems_libio_iops'
collect2: error: ld returned 1 exit status
-----------

karvel/meson.build:190:11: ERROR: C static library 'karvel_endurance' not found

To Reproduce

  1. uv tool install meson@1.9.2
  2. meson setup build/ --cross cross_riscv-rtems5-noel32imafd.ini
  3. Setup works
  4. uv tool install meson@1.10.1
  5. rm -Rf build/
  6. meson setup build/ --cross cross_riscv-rtems5-noel32imafd.ini
  7. Setup fails

I have attached the meson-logs.txt for each case and the cross file I am using

The relevant part of the meson.build file are:

# Binary libraries
karvel_bin_lib = [
  'modules/karvel_endurance',
]

cc = meson.get_compiler('c')
root = meson.current_source_dir()

# We deal with binary modules first, since source modules are likely to depend on them
foreach l : karvel_bin_lib

  # Fetch variables from subdir
  subdir(l)

  lib = cc.find_library(lib_name, dirs: [f'@root@/@l@/lib'], required: true, static: true)

meson-log.1.9.2.txt
meson-log.1.10.1.txt
cross_riscv-rtems5-noel32imafd.ini.txt

Expected behavior
Setup should work as before

system parameters

  • Cross-build
  • OS: Ubuntu 24.04 LTS
  • Python 3.13.3
  • Meson 1.10.1
  • Ninja 1.13.0

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions