]> granicus.if.org Git - libx264/commitdiff
configure: Always make shared imply PIC
authorJessica Clarke <jrtc27@jrtc27.com>
Sun, 19 Dec 2021 22:13:09 +0000 (22:13 +0000)
committerAnton Mitrofanov <bugmaster@narod.ru>
Thu, 30 Dec 2021 20:10:51 +0000 (20:10 +0000)
Building a shared library without -fPIC does not make sense. On most
architectures, especially recent ones, doing so will give link-time
errors due to relocations in read-only sections like .text. On some
legacy architectures, including i386, it is allowed by default, but will
warn, and is highly discouraged due to the overheads it adds at library
load time. Most architectures were already listed here as having shared
imply PIC, but not all, such as i386 which ends up with unwanted text
relocations, as well as architectures not known to the build system
currently like RISC-V, which does not permit text relocations by
default. There is no good reason to want shared without PIC on any
architecture, so just remove the architecture list.

configure

index b4426d62e8fe7429f6190da65ee7a2891e9b59e2..e0f79f6cc0f4ba80d48f87d1a9b94b7c4bedc419 100755 (executable)
--- a/configure
+++ b/configure
@@ -921,7 +921,7 @@ if [ $compiler_style = GNU ]; then
     fi
 fi
 
-if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" -o $ARCH = "IA64" -o $ARCH = "PARISC" -o $ARCH = "MIPS" -o $ARCH = "AARCH64" \) ] ; then
+if [ $shared = yes ] ; then
     pic="yes"
 fi