Closed furkanonder closed 3 months ago
Kindly fix the issue, it is breaking to install on FREEBSD.
When investigating this issue, I found that building Python on FreeBSD with --enable-profiling
, which leads to adding the -pg
compile flag on x86_64, will cause the compiled binary to crash. This will mislead autoconf tools and result in invalid compiler/linker flags.
In my case, it wrongly specified -latomic
linker flags, resulting in the compiling process stopping. This is described in issue #117452.
I suspect this is the same issue, but you are using an ARM machine, so the behavior may be different (-latomic
is needed when building on ARM). Since I don't have an ARM device on which FreeBSD can run, I can't ensure this. Could you please check and post the config.log
here in the CPython repository's root path after configuring and making?
When investigating this issue, I found that building Python on FreeBSD with
--enable-profiling
, which leads to adding the-pg
compile flag on x86_64, will cause the compiled binary to crash. This will mislead autoconf tools and result in invalid compiler/linker flags.In my case, it wrongly specified
-latomic
linker flags, resulting in the compiling process stopping. This is described in issue #117452.I suspect this is the same issue, but you are using an ARM machine, so the behavior may be different (
-latomic
is needed when building on ARM). Since I don't have an ARM device on which FreeBSD can run, I can't ensure this. Could you please check and post theconfig.log
here in the CPython repository's root path after configuring and making?
The file is quite long, 33952 lines. config.log
$ cat -n config.log | grep environ
6860 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
8477 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
16574 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
16921 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
19817 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
23292 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
23784 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
24213 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
25113 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
25567 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
26872 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
27759 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
28193 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
28636 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
29682 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
30139 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
30602 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
31593 ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
around 6860 lines from config.log
configure:13719: result: no
configure:13780: checking aligned memory access is required
configure:13813: cc -o conftest -pg conftest.c -ldl >&5
configure:13813: $? = 0
configure:13813: ./conftest
ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
configure:13813: $? = 1
Also, I get the same result with your test program;
[freebsd@generic ~]$ cat a.c
#include <stdlib.h>
#include <stdio.h>
int main() {
puts(getenv("PATH"));
}
[freebsd@generic ~]$ clang -pg a.c -lutil
[freebsd@generic ~]$ ./a.out
ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
[freebsd@generic ~]$ cc -v
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
Target: aarch64-unknown-freebsd13.2
Thread model: posix
InstalledDir: /usr/bin
[freebsd@generic ~]$
Yes, so I think it's the same problem. I reported it to FreeBSD upstream, maybe we can wait for their reply.
@aisk:
Yes, so I think it's the same problem. I reported it to FreeBSD upstream, maybe we can wait for their reply.
Can you share the link of the FreeBSD issue?
Since the issue is in FreeBSD and not in Python (can be reproduced with a short C program), the issue was reported to FreeBSD, I close the issue. There is no need to track the issue in the Python bug tracker.
Bug report
Bug description:
Configuration:
Output:
Output:
Environment
CPython versions tested on:
CPython main branch
Operating systems tested on:
Other