Closed aisk closed 5 months ago
I think -latomic
is not needed on x86-64. After some investigation, I found that when I remove the -latomic
link flag in the Makefile manually, the compilation can proceed. However, it fails with:
./Programs/_freeze_module getpath ./Modules/getpath.py Python/frozen_modules/getpath.h
ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
And run ./Programs/_freeze_module
binary, I got the same error:
ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
And then when checking the config.log
, I found that:
configure:28439: checking whether libatomic is needed by <pyatomic.h>
configure:28489: cc -pthread -o conftest -I. -I./Include -pg conftest.c -ldl -lutil >&5
conftest.c:445:9: warning: 'PY_BUILTIN_HASHLIB_HASHES' macro redefined [-Wmacro-redefined]
445 | #define PY_BUILTIN_HASHLIB_HASHES "md5,sha1,sha2,sha3,blake2"
| ^
conftest.c:444:9: note: previous definition is here
444 | #define PY_BUILTIN_HASHLIB_HASHES /**/
| ^
1 warning generated.
configure:28489: $? = 0
configure:28489: ./conftest
ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
configure:28489: $? = 1
configure: program exited with status 1
So it's the same issue that _freeze_module
, and this leads to autoconf think the -latomic
is needed.
Maybe this is a FreeBSD / clang issue, when compiling this simple file a.c
:
#include <stdlib.h>
#include <stdio.h>
int main() {
puts(getenv("PATH"));
}
with clang -pg a.c -lutil
, the build result have the same error:
$ ./a.out
ld-elf.so.1: /lib/libc.so.7: Undefined symbol "environ"
Maybe this is a FreeBSD / clang issue
Can you report the issue to FreeBSD?
@vstinner Already reported: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269370
@vstinner Already reported: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269370
Oh ok, thanks!
Since this issue is in FreeBSD and not Python, the bug was already reported to FreeBSD, I close the issue.
Bug report
Bug description:
Environment:
Configuration:
./configure --enable-profiling --disable-ipv6
,--disable-ipv6
is needed because it's reuired by--enable-profiling
.Error:
CPython versions tested on:
CPython main branch
Operating systems tested on:
Other