void-packages/srcpkgs/pcc/patches/build_PIC.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

34 lines
1.2 KiB
Diff

Respect passed CFLAGS to configure and force PIC object generation.
--- a/pcc-libs/csu/linux/Makefile 2011-02-24 12:59:36.988078869 +0100
+++ b/pcc-libs/csu/linux/Makefile 2011-02-24 13:01:29.434007771 +0100
@@ -4,7 +4,7 @@ VERSION ?= 0.9.9
PCCLIBDIR ?= /usr/local/lib/pcc/$(TARGET)/$(VERSION)/lib
SRCDIR ?= .
-CFLAGS = -I$(SRCDIR)/$(MACH) -I$(SRCDIR) -Wall -Wstrict-prototypes -Wmissing-prototypes
+CFLAGS += -fpic -fPIC -I$(SRCDIR)/$(MACH) -I$(SRCDIR) -Wall -Wstrict-prototypes -Wmissing-prototypes
OBJS = crt0.o crt1.o gcrt1.o crti.o crtn.o crtbegin.o crtend.o
--- a/pcc-libs/libpcc/Makefile.in 2011-02-24 13:02:15.570566278 +0100
+++ b/pcc-libs/libpcc/Makefile.in 2011-02-24 13:02:33.577393664 +0100
@@ -12,6 +12,7 @@ exec_prefix = @exec_prefix@
libdir = @libdir@
CC = @CC@
+CFLAGS = @CFLAGS@ -fpic -fPIC
TARGMACH = @targmach@
TARGOS = @targos@
TARGET = @target@
--- a/pcc-libs/libsoftfloat/Makefile.in 2011-02-24 13:02:54.937188695 +0100
+++ b/pcc-libs/libsoftfloat/Makefile.in 2011-02-24 13:03:09.281050924 +0100
@@ -12,6 +12,7 @@ exec_prefix = @exec_prefix@
libdir = @libdir@
CC = @CC@
+CFLAGS = @CFLAGS@ -fpic -fPIC
TARGET = @target@
TARGMACH = @targmach@
VERSION = @version@