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

ld.lld: error: undefined symbol: efi_error_set #223

Open
tpgxyz opened this issue Jun 29, 2022 · 0 comments
Open

ld.lld: error: undefined symbol: efi_error_set #223

tpgxyz opened this issue Jun 29, 2022 · 0 comments

Comments

@tpgxyz
Copy link
Contributor

tpgxyz commented Jun 29, 2022

Looks like efivar does not like LTO

/usr/bin/clang -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -flto -Oz -std=gnu11 -funsigned-char -fvisibility=hidden   -std=gnu11 -funsigned-char -fvisibility=hidden   -fPIC  -DLIBEFIVAR_VERSION=38 -D_GNU_SOURCE -I/builddir/build/BUILD/efivar-38/src/include/ -c -o sec.o sec.c
/usr/bin/clang -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -flto -Oz -std=gnu11 -funsigned-char -fvisibility=hidden   -std=gnu11 -funsigned-char -fvisibility=hidden   -fPIC  -DLIBEFIVAR_VERSION=38 -D_GNU_SOURCE -I/builddir/build/BUILD/efivar-38/src/include/ -c -o secdb.o secdb.c
/usr/bin/clang -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -flto -Oz -std=gnu11 -funsigned-char -fvisibility=hidden   -std=gnu11 -funsigned-char -fvisibility=hidden   -fPIC  -DLIBEFIVAR_VERSION=38 -D_GNU_SOURCE -I/builddir/build/BUILD/efivar-38/src/include/ -c -o esl-iter.o esl-iter.c
/usr/bin/clang -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -flto -Oz -std=gnu11 -funsigned-char -fvisibility=hidden   -std=gnu11 -funsigned-char -fvisibility=hidden   -fPIC  -DLIBEFIVAR_VERSION=38 -D_GNU_SOURCE -I/builddir/build/BUILD/efivar-38/src/include/ -c -o util.o util.c
/usr/bin/clang -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -flto -Oz -std=gnu11 -funsigned-char -fvisibility=hidden   -std=gnu11 -funsigned-char -fvisibility=hidden   -L. -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -flto -Oz -std=gnu11 -funsigned-char -fvisibility=hidden   -L. -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -flto -Oz -Wl,-O2  -Wl,--no-undefined -flto   -Wl,--build-id -Wl,--no-allow-shlib-undefined -Wl,--no-undefined-version -Wl,-z,now -Wl,-z,muldefs -Wl,-z,relro -Wl,--fatal-warnings -rtlib=compiler-rt    -Wl,--build-id -Wl,--no-allow-shlib-undefined -Wl,--no-undefined-version -Wl,-z,now -Wl,-z,muldefs -Wl,-z,relro -Wl,--fatal-warnings -rtlib=compiler-rt    -DLIBEFIVAR_VERSION=38 -D_GNU_SOURCE -I/builddir/build/BUILD/efivar-38/src/include/  -shared -Wl,-soname,libefisec.so.1 -Wl,--version-script=libefisec.map  \
	 \
	-o libefisec.so sec.o secdb.o esl-iter.o util.o  
ld.lld: error: undefined symbol: efi_error_set
>>> referenced by secdb.c:20
>>>               lto.tmp:(efi_secdb_new)
>>> referenced by secdb.c:309
>>>               lto.tmp:(efi_secdb_set_bool)
>>> referenced by secdb.c:303
>>>               lto.tmp:(efi_secdb_set_bool)
>>> referenced 23 more times
ld.lld: error: undefined symbol: efi_get_logfile
>>> referenced by util.h:310 (./util.h:310)
>>>               lto.tmp:(log_)
ld.lld: error: undefined symbol: efi_guid_cmp
>>> referenced by secdb.c:165
>>>               lto.tmp:(efi_secdb_del_entry)
>>> referenced by secdb.c:691
>>>               lto.tmp:(secdb_entry_cmp)
>>> referenced by esl-iter.c:123
>>>               lto.tmp:(esl_iter_next_with_size_correction)
>>> referenced 1 more times
ld.lld: error: undefined symbol: efi_guid_x509_cert
>>> referenced by secdb.c:0
>>>               lto.tmp:(find_secdb_entry)
>>> referenced by secdb.c:0
>>>               lto.tmp:(find_secdb_entry)
>>> referenced by esl-iter.c:123
>>>               lto.tmp:(esl_iter_next_with_size_correction)
>>> referenced 4 more times
ld.lld: error: undefined symbol: efi_guid_to_id_guid
>>> referenced by secdb.c:48
>>>               lto.tmp:(find_secdb_entry)
ld.lld: error: undefined symbol: efi_set_loglevel
>>> referenced by ld-temp.o
>>>               lto.tmp:(OUTLINED_FUNCTION_3)
ld.lld: error: undefined symbol: efi_guid_x509_sha256
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
ld.lld: error: undefined symbol: efi_guid_sha256
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
ld.lld: error: undefined symbol: efi_guid_x509_sha512
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
ld.lld: error: undefined symbol: efi_guid_sha512
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
ld.lld: error: undefined symbol: efi_guid_x509_sha384
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
ld.lld: error: undefined symbol: efi_guid_sha224
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
ld.lld: error: undefined symbol: efi_guid_sha384
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
ld.lld: error: undefined symbol: efi_guid_sha1
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
ld.lld: error: undefined symbol: efi_guid_rsa2048
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
ld.lld: error: undefined symbol: efi_guid_rsa2048_sha1
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
ld.lld: error: undefined symbol: efi_guid_rsa2048_sha256
>>> referenced by ld-temp.o
>>>               lto.tmp:(efi_secdb_algs_)
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: Leaving directory '/builddir/build/BUILD/efivar-38/src'
make[1]: *** [/builddir/build/BUILD/efivar-38/src/include/rules.mk:39: libefisec.so] Error 1
make: *** [Makefile:14: all] Error 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant