Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 873901 - dev-lang/luajit Compile error if using clang
Summary: dev-lang/luajit Compile error if using clang
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-01 19:53 UTC by Charababis
Modified: 2022-10-01 22:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charababis 2022-10-01 19:53:13 UTC
Luajit tries to link using the command 

$CC   -shared -fPIC -Wl,-soname,libluajit-5.1.so.2   -o libluajit.so lj_vm.o lj_assert.o lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o lj_buf.o lj_str.o lj_tab.o lj_func.o lj_udata.o lj_meta.o lj_debug.o lj_prng.o lj_state.o lj_dispatch.o lj_vmevent.o lj_vmmath.o lj_strscan.o lj_strfmt.o lj_strfmt_num.o lj_serialize.o lj_api.o lj_profile.o lj_lex.o lj_parse.o lj_bcread.o lj_bcwrite.o lj_load.o lj_ir.o lj_opt_mem.o lj_opt_fold.o lj_opt_narrow.o lj_opt_dce.o lj_opt_loop.o lj_opt_split.o lj_opt_sink.o lj_mcode.o lj_snap.o lj_record.o lj_crecord.o lj_ffrecord.o lj_asm.o lj_trace.o lj_gdbjit.o lj_ctype.o lj_cdata.o lj_cconv.o lj_ccall.o lj_ccallback.o lj_carith.o lj_clib.o lj_cparse.o lj_lib.o lj_alloc.o lib_aux.o lib_base.o lib_math.o lib_bit.o lib_string.o lib_table.o lib_io.o lib_os.o lib_package.o lib_debug.o lib_jit.o lib_ffi.o lib_buffer.o lib_init.o -lm -ldl

which when used with gcc just links the file(instead of using a real linker) but when using clang the output is: 

lj_assert.o: file not recognized: file format not recognized
clang-14: error: linker command failed with exit code 1

then the build fails and a fallback gcc env should be used.
Comment 1 Ionen Wolkens gentoo-dev 2022-10-01 20:03:01 UTC
emerge --info? If you need some LDFLAGS for clang to work, then it's likely a duplicate a bug #759967 (aka, problem is that luajit doesn't respect LDFLAGS, which is bad but not a clang issue).

I can compile this with clang fine if I keep it basic or rely on clang's default-* USE.
Comment 2 Ionen Wolkens gentoo-dev 2022-10-01 20:09:52 UTC
(In reply to Ionen Wolkens from comment #1)
> emerge --info?
Ideally full build.log too, forgot to mention (esp if need to debug this further if it's not LDFLAGS).