huluwa
November 14, 2024, 2:30am
1
在Ubuntu24.04 主机上
主机环境安装
sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
使用下面配置获取kernel 6.1,编译
mkdir ~/src/khadas-kernel/ && cd $_
repo init -u BayLibre / amlogic / Android TV / aosp / kernel / manifest · GitLab -b yukawa-android-14-6.1
repo sync
会有如下错误,这会是哪里配置导致?
ld.lld: error: undefined symbol: __isoc23_strtoul
opened 06:09PM - 20 Dec 23 UTC
bug
### Zig Version
0.11.0 and 0.12.0-dev.1814+5c0d58b71
### Steps to Reproduce an… d Observed Behavior
Here is a repository with reproduction steps and an error message: https://github.com/greenfork/isoc23.
Here they are verbatim:
```
$ git clone https://github.com/greenfork/isoc23.git
$ cd isoc23
# Wait a bit because this command downloads a large Raylib repository!
$ git submodule update --init --recursive jaylib
# Add janet.h to the hardcoded in jaylib include path (remember to delete it afterwords)
$ sudo mkdir /usr/local/include/janet
$ sudo cp src/janet.h /usr/local/include/janet/
$ zig version
0.11.0
$ zig build # works fine
$ zig build -Dtarget=x86_64-linux-gnu # fails
zig build-exe isoc23 Debug x86_64-linux-gnu: error: the following command failed with 3 compilation errors:
/home/grfork/zig-linux-x86_64-0.11.0/zig build-exe -cflags -std=c99 -DJANET_BUILD_TYPE=release -- /tmp/isoc23/src/thehouse_hello_world.c /tmp/isoc23/src/janet.c /tmp/isoc23/zig-cache/o/a488295558bcebe973d5d2fd0f35b729/libraylib.a -lGL -lX11 /tmp/isoc23/zig-cache/o/75663b2f53ebaf3a2586f24809272912/libjaylib.a -lc --cache-dir /tmp/isoc23/zig-cache --global-cache-dir /home/grfork/.cache/zig --name isoc23 -target x86_64-linux-gnu -mcpu x86_64 -I /tmp/isoc23/src -L /usr/lib --listen=-
Build Summary: 3/6 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install isoc23 transitive failure
└─ zig build-exe isoc23 Debug x86_64-linux-gnu 3 errors
error: ld.lld: undefined symbol: __isoc23_strtol
note: referenced by init.c:213 (jaylib/raylib/src/external/glfw/src/init.c:213)
note: /tmp/isoc23/zig-cache/o/1dfae6069d01d348c4482230698d5016/rglfw.o:(_glfwParseUriList) in archive /tmp/isoc23/zig-cache/o/a488295558bcebe973d5d2fd0f35b729/libraylib.a
error: ld.lld: undefined symbol: __isoc23_sscanf
note: referenced by context.c:408 (jaylib/raylib/src/external/glfw/src/context.c:408)
note: /tmp/isoc23/zig-cache/o/1dfae6069d01d348c4482230698d5016/rglfw.o:(_glfwRefreshContextAttribs) in archive /tmp/isoc23/zig-cache/o/a488295558bcebe973d5d2fd0f35b729/libraylib.a
note: referenced by tinyobj_loader_c.h:792 (jaylib/raylib/src/external/tinyobj_loader_c.h:792)
note: /tmp/isoc23/zig-cache/o/7fbd155baba90ba2941e259d327944c1/rmodels.o:(tinyobj_parse_and_index_mtl_file) in archive /tmp/isoc23/zig-cache/o/a488295558bcebe973d5d2fd0f35b729/libraylib.a
note: referenced by glad.h:8550 (jaylib/raylib/src/external/glad.h:8550)
note: /tmp/isoc23/zig-cache/o/c8be532591c10fa8971ba04591cac7e4/rcore.o:(glad_gl_find_core_gl) in archive /tmp/isoc23/zig-cache/o/a488295558bcebe973d5d2fd0f35b729/libraylib.a
note: referenced 6 more times
error: ld.lld: undefined symbol: __isoc23_strtoul
note: referenced by input.c:223 (jaylib/raylib/src/external/glfw/src/input.c:223)
note: /tmp/isoc23/zig-cache/o/1dfae6069d01d348c4482230698d5016/rglfw.o:(parseMapping) in archive /tmp/isoc23/zig-cache/o/a488295558bcebe973d5d2fd0f35b729/libraylib.a
note: referenced by input.c:224 (jaylib/raylib/src/external/glfw/src/input.c:224)
note: /tmp/isoc23/zig-cache/o/1dfae6069d01d348c4482230698d5016/rglfw.o:(parseMapping) in archive /tmp/isoc23/zig-cache/o/a488295558bcebe973d5d2fd0f35b729/libraylib.a
note: referenced by input.c:228 (jaylib/raylib/src/external/glfw/src/input.c:228)
note: /tmp/isoc23/zig-cache/o/1dfae6069d01d348c4482230698d5016/rglfw.o:(parseMapping) in archive /tmp/isoc23/zig-cache/o/a488295558bcebe973d5d2fd0f35b729/libraylib.a
$ zig version # same on master
0.12.0-dev.1814+5c0d58b71
$ zig build -Dtarget=x86_64-linux-gnu # fails
$ sudo rm -r /usr/local/include/janet
```
### Expected Behavior
The project compiles with any target specified.
About the project, it uses Zig to compile a C project:
- Janet language with amalgamation build `src/janet.c` and `src/janet.h`
- Raylib using its `build.zig` in `jaylib/raylib/src/build.zig` maintained independently from me
- Jaylib wrapper around Raylib for Janet in `jaylib/build.zig` that I wrote
There are two issues I found, probably related:
- https://github.com/llvm/llvm-project/issues/64388
- https://github.com/ziglang/zig/issues/17536
And also an explanation about the `#define _GNU_SOURCE` which is present in janet.c: https://github.com/openssl/openssl/issues/22833
网上信息都是介绍llvm和glibc版本问题引起,修改方式,看了下在代码中没有对应修改东西,还请帮助看下这是哪里配置引起需要怎么修改下,还是说要把主机系统版本降下来?有没有一个aosp 开发的docker可以使用的?
ERROR: /home/gjy/project/khadas/yukawa-device/BUILD.bazel:157:13: Preparing for module build (lto=default;notrim) @//yukawa-device:yukawa_modules_prepare failed: (Exit 2): bash failed: error executing ModulesPrepare command (from target //yukawa-device:yukawa_modules_prepare) /bin/bash -c … (remaining 1 argument skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
ld.lld: error: undefined symbol: __isoc23_strtol
referenced by stdlib.h:483 (/usr/include/stdlib.h:483)
libsubcmd-in.o:(pretty_print_string_list) in archive /home/gjy/project/khadas/out/bazel/output_user_root/5d753b3969f8e3d08a95560f1469f2bb/sandbox/linux-sandbox/13/execroot/main /out/android14-6.1/common/tools/bpf/resolve_btfids//libsubcmd/libsubcmd.a
referenced by stdlib.h:483 (/usr/include/stdlib.h:483)
libsubcmd-in.o:(pretty_print_string_list) in archive /home/gjy/project/khadas/out/bazel/output_user_root/5d753b3969f8e3d08a95560f1469f2bb/sandbox/linux-sandbox/13/execroot/main /out/android14-6.1/common/tools/bpf/resolve_btfids//libsubcmd/libsubcmd.a
referenced by stdlib.h:483 (/usr/include/stdlib.h:483)
libsubcmd-in.o:(pager_get_columns) in archive /home/gjy/project/khadas/out/bazel/output_user_root/5d753b3969f8e3d08a95560f1469f2bb/sandbox/linux-sandbox/13/execroot/main /out/android14-6.1/common/tools/bpf/resolve_btfids//libsubcmd/libsubcmd.a
referenced 2 more times
ld.lld: error: undefined symbol: __isoc23_strtoul
referenced by parse-options.c:314 (/home/gjy/project/khadas/out/bazel/output_user_root/5d753b3969f8e3d08a95560f1469f2bb/sandbox/linux-sandbox/13/execroot/main /common/tools/lib/subcmd/parse-options.c:314)
libsubcmd-in.o:(get_value) in archive /home/gjy/project/khadas/out/bazel/output_user_root/5d753b3969f8e3d08a95560f1469f2bb/sandbox/linux-sandbox/13/execroot/main /out/android14-6.1/common/tools/bpf/resolve_btfids//libsubcmd/libsubcmd.a
ld.lld: error: undefined symbol: __isoc23_strtoull
referenced by parse-options.c:332 (/home/gjy/project/khadas/out/bazel/output_user_root/5d753b3969f8e3d08a95560f1469f2bb/sandbox/linux-sandbox/13/execroot/main /common/tools/lib/subcmd/parse-options.c:332)
libsubcmd-in.o:(get_value) in archive /home/gjy/project/khadas/out/bazel/output_user_root/5d753b3969f8e3d08a95560f1469f2bb/sandbox/linux-sandbox/13/execroot/main /out/android14-6.1/common/tools/bpf/resolve_btfids//libsubcmd/libsubcmd.a
clang-17: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [Makefile:75: /home/gjy/project/khadas/out/bazel/output_user_root/5d753b3969f8e3d08a95560f1469f2bb/sandbox/linux-sandbox/13/execroot/main /out/android14-6.1/common/tools/bpf/resolve_btfids//resolve_btfids] Error 1
make[2]: *** [Makefile:76: bpf/resolve_btfids] Error 2
make[1]: *** [/home/gjy/project/khadas/out/bazel/output_user_root/5d753b3969f8e3d08a95560f1469f2bb/sandbox/linux-sandbox/13/execroot/main /common/Makefile:1481: tools/bpf/resolve_btfids] Error 2
make[1]: *** Waiting for unfinished jobs…
make: *** [Makefile:256: __sub-make] Error 2
你好,我们目前没有在24.04上编译过这个,建议使用22.04的版本上编译
huluwa:
在Ubuntu24.04 主机上
huluwa
November 22, 2024, 2:45am
3
多谢!问题已经解决,从Android上下载补丁修复了.