cloudius-systems / osv

OSv, a new operating system for the cloud.
osv.io
Other
4.08k stars 601 forks source link

IFUNC symbol wcslen creates circular dependency #1326

Open Martin-Lndbl opened 2 months ago

Martin-Lndbl commented 2 months ago

After getting the build process on NixOs working for the most part, I get following error when building with glibc.static present:

Building into build/release.x64
  GEN gen/include/osv/version.h
fatal: No names found, cannot describe anything.
  GEN gen/include/osv/drivers_config.h
  GEN build/release.x64/gen/include/bits/alltypes.h
  AS arch/x64/boot.S
  CXX loader.cc
  HOST_CXX build/release.x64/gen-ctype-data
  GEN build/release.x64/gen/include/ctype-data.h
build/release.x64/gen-ctype-data: IFUNC symbol 'wcslen' referenced in '/nix/store/bn7pnigb0f8874m6riiw6dngsmdyic1g-gcc-13.3.0-lib/lib/libstdc++.so.6' is defined in the executable and creates an unsatisfiable circular dependency.
make: *** [Makefile:2298: build/release.x64/gen/include/ctype-data.h] Error 127
make: *** Deleting file 'build/release.x64/gen/include/ctype-data.h'
make failed. Exiting from build script

If I try to build without glibc.static present, the build runs though, until the end, where the linker (obviously) cannot find the c library. My glibc version is 2.39-52 and I tried with gcc 11, 13 and 14

gburd commented 2 months ago

Martin, As a fellow NixOS user and OSv fan could you please share your work? Are you creating a flake? I’m very curious about your work and would contribute to it myself. -Greg

On Sat, Jul 6, 2024 at 9:29 AM, Martin Lindbüchl @.> wrote: After getting the build process on NixOs working for the most part, I get following error when building with glibc.static present: Building into build/release.x64 GEN gen/include/osv/version.h fatal: No names found, cannot describe anything. GEN gen/include/osv/drivers_config.h GEN build/release.x64/gen/include/bits/alltypes.h AS arch/x64/boot.S CXX loader.cc HOST_CXX build/release.x64/gen-ctype-data GEN build/release.x64/gen/include/ctype-data.h build/release.x64/gen-ctype-data: IFUNC symbol 'wcslen' referenced in '/nix/store/bn7pnigb0f8874m6riiw6dngsmdyic1g-gcc-13.3.0-lib/lib/libstdc++.so.6' is defined in the executable and creates an unsatisfiable circular dependency. make: [Makefile:2298: build/release.x64/gen/include/ctype-data.h] Error 127 make: *** Deleting file 'build/release.x64/gen/include/ctype-data.h' make failed. Exiting from build script If I try to build without glibc.static present, the build runs though, until the end, where the linker (obviously) cannot find the c library.

My glibc version is 2.39-52 and I tried with gcc 11, 13 and 14

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Martin-Lndbl commented 2 months ago

You can check out what I did so far on the feature branch of my fork. I'm sure there are still a lot of unnecessary dependencies but I got it working for now.

The unikernel can be built (without glibc.static present). But the native-example I tried to compile requires a static c library. So at the moment either the kernel or the app needs to be compiled before running ./scripts/build image=native-example to not run into this issue. (Or you run it twice, once without glibc.static present in your nativeBuildInputs to compile the kernel and then again with glibc.static to build the app and link everything together.