leanprover / lean4

Lean 4 programming language and theorem prover
https://lean-lang.org
Apache License 2.0
4.71k stars 424 forks source link

linker error on FreeBSD #5917

Open yurivict opened 2 weeks ago

yurivict commented 2 weeks ago

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

Build breaks:

ld: error: undefined symbol: l_Lake_cli
>>> referenced by LakeMain.c
>>>               ../../../.build/stage0/lib/temp/LakeMain.o.export:(_lean_main)

ld: error: undefined symbol: initialize_Lake
>>> referenced by LakeMain.c
>>>               ../../../.build/stage0/lib/temp/LakeMain.o.export:(initialize_LakeMain)

ld: error: undefined symbol: initialize_Lake_CLI
>>> referenced by LakeMain.c
>>>               ../../../.build/stage0/lib/temp/LakeMain.o.export:(initialize_LakeMain)
cc: error: linker command failed with exit code 1 (use -v to see invocation)

Context

FreeBSD port, clang-18 compiler.

The only place where initialize_Lake is defined is stage0/stdlib/Lake.c, and there is this if0def there: #elif defined(__GNUC__) && !defined(__CLANG__).

Why is this ifdef removing initialize_Lake when clang is used?

Version: 4.13.0

Kha commented 1 week ago

Why is this ifdef removing initialize_Lake when clang is used?

Please read the code more carefully, that call is not part of the ifdef