diff mbox

[3/4] cups: fix static linking problem

Message ID 1463235434-31134-3-git-send-email-thomas.petazzoni@free-electrons.com
State Accepted
Commit da4264210f14259961352b9be39a4e1b10e6ed28
Headers show

Commit Message

Thomas Petazzoni May 14, 2016, 2:17 p.m. UTC
In static linking configurations, cups fails to build due to the lack of
Scrt1.o from uClibc toolchains. This Scrt1.o is only needed for PIE
binaries. Since we don't really care about PIE binaries in the context
of Buildroot, this commit solves the problem by patching cups to not
generate a PIE binary.

Fixes:

  http://autobuild.buildroot.net/results/445a401da2f63a6c43d7c166516287db6cc977ab/

Cc: Olivier Schonken <olivier.schonken@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/cups/0004-remove-pie.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 package/cups/0004-remove-pie.patch

Comments

Olivier Schonken May 17, 2016, 8:47 a.m. UTC | #1
Hi Thomas

Thanks for fixing this issue.  I had unfortunately parked it to focus on
more pressing issues.

The patch looks good, and fixes the build error.

Regards

Olivier

On 14 May 2016 at 16:17, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:

> In static linking configurations, cups fails to build due to the lack of
> Scrt1.o from uClibc toolchains. This Scrt1.o is only needed for PIE
> binaries. Since we don't really care about PIE binaries in the context
> of Buildroot, this commit solves the problem by patching cups to not
> generate a PIE binary.
>
> Fixes:
>
>
> http://autobuild.buildroot.net/results/445a401da2f63a6c43d7c166516287db6cc977ab/
>
> Cc: Olivier Schonken <olivier.schonken@gmail.com>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  package/cups/0004-remove-pie.patch | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>  create mode 100644 package/cups/0004-remove-pie.patch
>
> diff --git a/package/cups/0004-remove-pie.patch
> b/package/cups/0004-remove-pie.patch
> new file mode 100644
> index 0000000..3d81941
> --- /dev/null
> +++ b/package/cups/0004-remove-pie.patch
> @@ -0,0 +1,21 @@
> +Remove PIE flags from the build
> +
> +Generating a statically linked binary built with PIE requires the
> +Scrt1.o file, which isn't part of Buildroot uClibc toolchains. To
> +solve this, we simply disable the PIE flags.
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +
> +Index: b/Makedefs.in
> +===================================================================
> +--- a/Makedefs.in
> ++++ b/Makedefs.in
> +@@ -142,7 +142,7 @@
> + IPPFIND_MAN   =       @IPPFIND_MAN@
> + LDFLAGS               =       -L../cgi-bin -L../cups -L../filter
> -L../ppdc \
> +                       -L../scheduler @LDARCHFLAGS@ \
> +-                      @LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
> ++                      @LDFLAGS@ @RELROFLAGS@ $(OPTIM)
> + LINKCUPS      =       @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(LIBZ)
> + LINKCUPSIMAGE =       @LINKCUPSIMAGE@
> + LIBS          =       $(LINKCUPS) $(COMMONLIBS)
> --
> 2.7.4
>
>
Peter Korsgaard May 25, 2016, 8:47 p.m. UTC | #2
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > In static linking configurations, cups fails to build due to the lack of
 > Scrt1.o from uClibc toolchains. This Scrt1.o is only needed for PIE
 > binaries. Since we don't really care about PIE binaries in the context
 > of Buildroot, this commit solves the problem by patching cups to not
 > generate a PIE binary.

 > Fixes:

 >   http://autobuild.buildroot.net/results/445a401da2f63a6c43d7c166516287db6cc977ab/

 > Cc: Olivier Schonken <olivier.schonken@gmail.com>
 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.
diff mbox

Patch

diff --git a/package/cups/0004-remove-pie.patch b/package/cups/0004-remove-pie.patch
new file mode 100644
index 0000000..3d81941
--- /dev/null
+++ b/package/cups/0004-remove-pie.patch
@@ -0,0 +1,21 @@ 
+Remove PIE flags from the build
+
+Generating a statically linked binary built with PIE requires the
+Scrt1.o file, which isn't part of Buildroot uClibc toolchains. To
+solve this, we simply disable the PIE flags.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/Makedefs.in
+===================================================================
+--- a/Makedefs.in
++++ b/Makedefs.in
+@@ -142,7 +142,7 @@
+ IPPFIND_MAN	=	@IPPFIND_MAN@
+ LDFLAGS		=	-L../cgi-bin -L../cups -L../filter -L../ppdc \
+ 			-L../scheduler @LDARCHFLAGS@ \
+-			@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
++			@LDFLAGS@ @RELROFLAGS@ $(OPTIM)
+ LINKCUPS	=	@LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(LIBZ)
+ LINKCUPSIMAGE	=	@LINKCUPSIMAGE@
+ LIBS		=	$(LINKCUPS) $(COMMONLIBS)