You are not logged in.

#1 2019-11-08 06:03:40

jinpin
Member
Registered: 2019-05-15
Posts: 7

Statically compiling Python 3.8

As you might have heard Fedora is planning to compile Python 3.8 statically. This should increase performance and effectiveness of LTO.

So I've tried to replicate it with our PKGBUILD:

  ./configure LDFLAGS="-static" \
              --disable-shared \

But there is always a PIC error when compiling in my clean chroot:

/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object

The following patch from Fedora wasn't necessary for me; and sadly also didn't fix the compilation error.

diff --git a/configure.ac b/configure.ac
index 807e379..6eedf9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1121,8 +1121,7 @@ if test $enable_shared = "yes"; then
           ;;
     Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
 	  LDLIBRARY='libpython$(LDVERSION).so'
-	  BLDLIBRARY='-L. -lpython$(LDVERSION)'
-	  RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
+	  BLDLIBRARY='$(LIBRARY_OBJS)'
 	  INSTSONAME="$LDLIBRARY".$SOVERSION
 	  if test "$with_pydebug" != yes
           then

Do you have any wise advice for me?

Offline

#2 2019-11-08 23:50:29

tannenbaum
Member
Registered: 2019-01-23
Posts: 8

Re: Statically compiling Python 3.8

Yes indeed, same error for me.

Offline

Board footer

Powered by FluxBB