From a014002fbb31da31fe6914a3c8e00b0b8f666f46 Mon Sep 17 00:00:00 2001 From: Joonas Niilola Date: Sun, 22 Sep 2024 21:43:49 +0300 Subject: dev-lang/swig: add missing patch file from upstream PR#2969 Bug: https://bugs.gentoo.org/900769 Bug: https://bugs.gentoo.org/935318 Signed-off-by: Joonas Niilola --- dev-lang/swig/files/swig-4.2.1-tests-fpic.patch | 115 ++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 dev-lang/swig/files/swig-4.2.1-tests-fpic.patch (limited to 'dev-lang/swig') diff --git a/dev-lang/swig/files/swig-4.2.1-tests-fpic.patch b/dev-lang/swig/files/swig-4.2.1-tests-fpic.patch new file mode 100644 index 000000000000..8f873937bd99 --- /dev/null +++ b/dev-lang/swig/files/swig-4.2.1-tests-fpic.patch @@ -0,0 +1,115 @@ +From e89960a53f6e10550f86588be705b3c6eb09d159 Mon Sep 17 00:00:00 2001 +From: matoro +Date: Mon, 22 Jul 2024 17:40:20 -0400 +Subject: [PATCH 1/2] Use -fPIC on Linux instead of -fpic + +On most platforms, these are identical. However, on a small list of +platforms, the small -fpic will enforce a limit on GOT size. However, +if -fPIC is used instead, then the GOT on these platforms will have no +limits. The affected platforms and the respective GOT limits with -fpic +are: 8k on sparc, 28k on aarch64, and 32k on m68k and powerpc. + +See: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fpic +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 25cdee1457..8561d27b35 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -230,7 +230,7 @@ then + fi;; + s390x*-*-*) CCSHARED="-fpic" ;; + s390*-*-*) CCSHARED="-fPIC" ;; +- *-*-linux*) CCSHARED="-fpic";; ++ *-*-linux*) CCSHARED="-fPIC";; + *-*-freebsd* | *-*-openbsd*) CCSHARED="-fpic";; + *-*-netbsd*) CCSHARED="-fPIC";; + *-sco-sysv*) CCSHARED="-KPIC -dy -Bdynamic";; + +From 16129d98041586af75f4c4cb71758e0eb3b49e6a Mon Sep 17 00:00:00 2001 +From: matoro +Date: Mon, 22 Jul 2024 17:46:29 -0400 +Subject: [PATCH 2/2] Update examples to recommend compiling with -fPIC instead + of -fpic + +To reflect previous change to swig defaults. +--- + Examples/go/simple/index.html | 6 +++--- + Examples/perl5/index.html | 2 +- + Examples/python/index.html | 2 +- + Examples/ruby/index.html | 2 +- + Examples/tcl/index.html | 2 +- + 5 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Examples/go/simple/index.html b/Examples/go/simple/index.html +index 21dfc239ed..45ec980cda 100644 +--- a/Examples/go/simple/index.html ++++ b/Examples/go/simple/index.html +@@ -72,10 +72,10 @@

Compilation

+ named example.a; e.g., gopack grc example.a example.6 + example_gc.6. +
  • Compile the example_wrap.c +- file using your standard C compiler with the -fpic option; +- e.g., gcc -c -O -fpic example_wrap.c. ++ file using your standard C compiler with the -fPIC option; ++ e.g., gcc -c -O -fPIC example_wrap.c. +
  • Also compile the actual code, not generated by SWIG; e.g., gcc +- -c -O -fpic example.c. ++ -c -O -fPIC example.c. +
  • Put the gcc compiled object files into a shared library; + e.g., gcc -shared -o example.so example_wrap.o example.o. +
  • Compile the program which demonstrates how to use the library; +diff --git a/Examples/perl5/index.html b/Examples/perl5/index.html +index 2daabaaf9c..122923bdc9 100644 +--- a/Examples/perl5/index.html ++++ b/Examples/perl5/index.html +@@ -42,7 +42,7 @@

    Compilation Issues

    +
    +
    + % swig -perl5 interface.i
    +-% gcc -fpic -c -Dbool=char -I/usr/lib/perl5/5.00503/i386-linux/CORE interface_wrap.c
    ++% gcc -fPIC -c -Dbool=char -I/usr/lib/perl5/5.00503/i386-linux/CORE interface_wrap.c
    + % gcc -shared interface_wrap.o $(OBJS) -o interface.so 
    + % perl
    + use interface;
    +diff --git a/Examples/python/index.html b/Examples/python/index.html
    +index fcb7eace8b..97c2036330 100644
    +--- a/Examples/python/index.html
    ++++ b/Examples/python/index.html
    +@@ -44,7 +44,7 @@ 

    Compilation Issues

    +
    +
    + % swig -python interface.i
    +-% gcc -fpic -c interface_wrap.c -I/usr/local/include/python1.5
    ++% gcc -fPIC -c interface_wrap.c -I/usr/local/include/python1.5
    + % gcc -shared interface_wrap.o $(OBJS) -o interfacemodule.so 
    + % python
    + Python 1.5.2 (#3, Oct  9 1999, 22:09:34)  [GCC 2.95.1 19990816 (release)] on linux2
    +diff --git a/Examples/ruby/index.html b/Examples/ruby/index.html
    +index ceb6c925d4..dee00c1d14 100644
    +--- a/Examples/ruby/index.html
    ++++ b/Examples/ruby/index.html
    +@@ -45,7 +45,7 @@ 

    Compilation Issues

    +
    +
    + % swig -ruby interface.i
    +-% gcc -fpic -c interface_wrap.c -I/usr/local/lib/ruby/1.4/i686-linux
    ++% gcc -fPIC -c interface_wrap.c -I/usr/local/lib/ruby/1.4/i686-linux
    + % gcc -shared interface_wrap.o $(OBJS) -o interface.so 
    + % ruby
    + require 'interface'
    +diff --git a/Examples/tcl/index.html b/Examples/tcl/index.html
    +index acd90029f3..5048186c67 100644
    +--- a/Examples/tcl/index.html
    ++++ b/Examples/tcl/index.html
    +@@ -44,7 +44,7 @@ 

    Compilation Issues

    +
    +
    + unix % swig -tcl interface.i
    +-unix % gcc -fpic -c interface_wrap.c -I/usr/local/include
    ++unix % gcc -fPIC -c interface_wrap.c -I/usr/local/include
    + unix % gcc -shared interface_wrap.o $(OBJS) -o interface.so
    + unix % tclsh8.3
    + % load ./interface.so
    -- 
    cgit v1.2.3-65-gdbad