8000 bpo-43112: detect musl as a separate SOABI by ncopa · Pull Request #24502 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43112: detect musl as a separate SOABI #24502

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

Merged
merged 10 commits into from
Jan 28, 2022
Prev Previous commit
Next Next commit
regenerate configure
  • Loading branch information
ncopa committed Feb 10, 2021
commit e45d9f5889a49bb66d67d7a79df364fe9e1accd1
19 changes: 18 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
Expand Down Expand Up @@ -910,6 +911,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
Expand Down Expand Up @@ -1162,6 +1164,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;

-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;

-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
Expand Down Expand Up @@ -1299,7 +1310,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
Expand Down Expand Up @@ -1452,6 +1463,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
Expand Down Expand Up @@ -5351,6 +5363,11 @@ EOF

if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
case "$build_os" in

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken, PLATFORM_TRIPLET should refer to the target platform on which cpython will run. If that is the case, the musl libc vs. glibc decision should be based on $host_os rather than $build_os as the former is based on autoconf's AC_CANONICAL_HOST macro1 which refers to the target platform that might differ from build platform in case of cross-compilation.

For example, the decision based on $build_os leads to
cpython 3.9.13 build failing2 when cross-compiling on AMD64 Linux with glibc for mpc8548 Linux (OpenWrt) with musl. (build runs correctly if $host_os is used)

Footnotes

  1. https://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/Canonicalizing.html

  2. "internal configure error for the platform triplet, please file a bug report"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the code is wrong. In fact the entire block should be revisited. We really should check for __GLIBC__ and use a heuristic to detect musl. Could you please open a new issue for the problem?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, but there's #87278 already. Is yet another issue needed?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #95855

linux-musl*)
PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'`
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PLATFORM_TRIPLET" >&5
$as_echo "$PLATFORM_TRIPLET" >&6; }
else
Expand Down
0