* [Buildroot] [PATCH] mosh: fix build with the Codescape IMG toolchain
@ 2016-04-05 18:03 Baruch Siach
2016-04-05 20:25 ` Baruch Siach
2016-04-05 21:47 ` Arnout Vandecappelle
0 siblings, 2 replies; 6+ messages in thread
From: Baruch Siach @ 2016-04-05 18:03 UTC (permalink / raw)
To: buildroot
The Codescape IMG toolchain does not provide the ssp library even though it's
a glibc toolchain, and thus selects BR2_TOOLCHAIN_HAS_SSP. Add a patch that
changes the compile test for -fstack-protector-all to a build test that
correctly fails when ssp is missing.
This makes the seeding of ssp related configure variables unnecessary.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
...ure.ac-link-test-for-fstack-protector-all.patch | 33 ++++++++++++++++++++++
package/mosh/mosh.mk | 11 ++------
2 files changed, 35 insertions(+), 9 deletions(-)
create mode 100644 package/mosh/0001-configure.ac-link-test-for-fstack-protector-all.patch
diff --git a/package/mosh/0001-configure.ac-link-test-for-fstack-protector-all.patch b/package/mosh/0001-configure.ac-link-test-for-fstack-protector-all.patch
new file mode 100644
index 000000000000..f8dc63b604fd
--- /dev/null
+++ b/package/mosh/0001-configure.ac-link-test-for-fstack-protector-all.patch
@@ -0,0 +1,33 @@
+From 5b3b697f50ba31842be544d6b54962df92c44958 Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Tue, 5 Apr 2016 15:24:55 +0300
+Subject: [PATCH] configure.ac: link test for -fstack-protector-all
+
+There are (broken) compilers out there that accept -fstack-protector-*
+parameters, but do not provide the needed ssp library. As a result, build does
+not fail, but link does. Use the local check_link_flag autoconf function to
+correctly test for SSP availability.
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+---
+Upstream status: https://github.com/mobile-shell/mosh/pull/733
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3c9dea03e40a..f5799689f2c1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -93,7 +93,7 @@ AS_IF([test x"$hardening" != x"no"], [
+ # This one will likely succeed, even on platforms where it does nothing.
+ check_cc_cxx_flag([-D_FORTIFY_SOURCE=2], [HARDEN_CFLAGS="$HARDEN_CFLAGS -D_FORTIFY_SOURCE=2"])
+
+- check_cc_cxx_flag([-fstack-protector-all],
++ check_link_flag([-fstack-protector-all],
+ [HARDEN_CFLAGS="$HARDEN_CFLAGS -fstack-protector-all"
+ check_cc_cxx_flag([-Wstack-protector], [HARDEN_CFLAGS="$HARDEN_CFLAGS -Wstack-protector"],
+ [], [-fstack-protector-all])
+--
+2.8.0.rc3
+
diff --git a/package/mosh/mosh.mk b/package/mosh/mosh.mk
index f8c45e8ccd2a..12691009da77 100644
--- a/package/mosh/mosh.mk
+++ b/package/mosh/mosh.mk
@@ -9,14 +9,7 @@ MOSH_SITE = https://mosh.mit.edu
MOSH_DEPENDENCIES = zlib ncurses protobuf openssl host-pkgconf
MOSH_LICENSE = GPLv3+ with exception
MOSH_LICENSE_FILES = COPYING COPYING.iOS
-
-# help the detection of the SSP support: mosh configure.ac doesn't do
-# a link test, so it doesn't detect when the toolchain doesn't have
-# libssp.
-ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
-MOSH_CONF_ENV += \
- ax_cv_check_cflags__Werror___fstack_protector_all=no \
- ax_cv_check_cxxflags__Werror___fstack_protector_all=no
-endif
+# Patching configure.ac
+MOSH_AUTORECONF = YES
$(eval $(autotools-package))
--
2.8.0.rc3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] mosh: fix build with the Codescape IMG toolchain
2016-04-05 18:03 [Buildroot] [PATCH] mosh: fix build with the Codescape IMG toolchain Baruch Siach
@ 2016-04-05 20:25 ` Baruch Siach
2016-04-05 21:47 ` Arnout Vandecappelle
1 sibling, 0 replies; 6+ messages in thread
From: Baruch Siach @ 2016-04-05 20:25 UTC (permalink / raw)
To: buildroot
Hi Buildroot list,
On Tue, Apr 05, 2016 at 09:03:32PM +0300, Baruch Siach wrote:
> The Codescape IMG toolchain does not provide the ssp library even though it's
> a glibc toolchain, and thus selects BR2_TOOLCHAIN_HAS_SSP. Add a patch that
> changes the compile test for -fstack-protector-all to a build test that
> correctly fails when ssp is missing.
>
> This makes the seeding of ssp related configure variables unnecessary.
If forgot to add autobuild references.
Fixes:
http://autobuild.buildroot.net/results/f57/f571cf13462833984504b6dabad98a6b0fb3facb/
http://autobuild.buildroot.net/results/a20/a206849cae4ecb8b2b9afb077852576ccad3536e/
http://autobuild.buildroot.net/results/86b/86b99fe4df64b47c9b76e75896a7470d84d504d7/
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] mosh: fix build with the Codescape IMG toolchain
2016-04-05 18:03 [Buildroot] [PATCH] mosh: fix build with the Codescape IMG toolchain Baruch Siach
2016-04-05 20:25 ` Baruch Siach
@ 2016-04-05 21:47 ` Arnout Vandecappelle
2016-04-05 23:08 ` Arnout Vandecappelle
2016-04-06 3:27 ` Baruch Siach
1 sibling, 2 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2016-04-05 21:47 UTC (permalink / raw)
To: buildroot
On 04/05/16 20:03, Baruch Siach wrote:
> The Codescape IMG toolchain does not provide the ssp library even though it's
> a glibc toolchain, and thus selects BR2_TOOLCHAIN_HAS_SSP. Add a patch that
> changes the compile test for -fstack-protector-all to a build test that
> correctly fails when ssp is missing.
>
> This makes the seeding of ssp related configure variables unnecessary.
So, this fixes the issue for mosh, but not for libpam-tacplus, powerpc-utils,
psmisc, ruby, sox, and stunnel...
Wouldn't it be better to fix BR2_TOOLCHAIN_HAS_SSP itself instead? Otherwise
there isn't much point in having this symbol... So it shouldn't be selected by
glibc/musl itself, but by the individual external toolchains. Cfr. the previous
discussion for sox [1].
That said, it would of course be a great idea to upstream the patch to mosh so
we can remove our workaround at some point.
Regards,
Arnout
[1] http://patchwork.ozlabs.org/patch/590047/
>
> Signed-off-by: Baruch Siach<baruch@tkos.co.il>
> ---
> ...ure.ac-link-test-for-fstack-protector-all.patch | 33 ++++++++++++++++++++++
> package/mosh/mosh.mk | 11 ++------
> 2 files changed, 35 insertions(+), 9 deletions(-)
> create mode 100644 package/mosh/0001-configure.ac-link-test-for-fstack-protector-all.patch
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] mosh: fix build with the Codescape IMG toolchain
2016-04-05 21:47 ` Arnout Vandecappelle
@ 2016-04-05 23:08 ` Arnout Vandecappelle
2016-04-05 23:23 ` Arnout Vandecappelle
2016-04-06 3:27 ` Baruch Siach
1 sibling, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2016-04-05 23:08 UTC (permalink / raw)
To: buildroot
On 04/05/16 23:47, Arnout Vandecappelle wrote:
> On 04/05/16 20:03, Baruch Siach wrote:
>> The Codescape IMG toolchain does not provide the ssp library even though it's
>> a glibc toolchain, and thus selects BR2_TOOLCHAIN_HAS_SSP. Add a patch that
>> changes the compile test for -fstack-protector-all to a build test that
>> correctly fails when ssp is missing.
>>
>> This makes the seeding of ssp related configure variables unnecessary.
>
> So, this fixes the issue for mosh, but not for libpam-tacplus, powerpc-utils,
> psmisc, ruby, sox, and stunnel...
>
> Wouldn't it be better to fix BR2_TOOLCHAIN_HAS_SSP itself instead? Otherwise
> there isn't much point in having this symbol... So it shouldn't be selected by
> glibc/musl itself, but by the individual external toolchains. Cfr. the previous
> discussion for sox [1].
And actually, Vicente already provided a patch for that:
http://patchwork.ozlabs.org/patch/597701/
It is at place fifty-something of my patches-to-review list :-)
Regards,
Arnout
>
> That said, it would of course be a great idea to upstream the patch to mosh so
> we can remove our workaround at some point.
>
> Regards,
> Arnout
>
> [1] http://patchwork.ozlabs.org/patch/590047/
>
>>
>> Signed-off-by: Baruch Siach<baruch@tkos.co.il>
>> ---
>> ...ure.ac-link-test-for-fstack-protector-all.patch | 33 ++++++++++++++++++++++
>> package/mosh/mosh.mk | 11 ++------
>> 2 files changed, 35 insertions(+), 9 deletions(-)
>> create mode 100644
>> package/mosh/0001-configure.ac-link-test-for-fstack-protector-all.patch
>
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] mosh: fix build with the Codescape IMG toolchain
2016-04-05 23:08 ` Arnout Vandecappelle
@ 2016-04-05 23:23 ` Arnout Vandecappelle
0 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2016-04-05 23:23 UTC (permalink / raw)
To: buildroot
On 04/06/16 01:08, Arnout Vandecappelle wrote:
> On 04/05/16 23:47, Arnout Vandecappelle wrote:
>> On 04/05/16 20:03, Baruch Siach wrote:
>>> The Codescape IMG toolchain does not provide the ssp library even though it's
>>> a glibc toolchain, and thus selects BR2_TOOLCHAIN_HAS_SSP. Add a patch that
>>> changes the compile test for -fstack-protector-all to a build test that
>>> correctly fails when ssp is missing.
>>>
>>> This makes the seeding of ssp related configure variables unnecessary.
>>
>> So, this fixes the issue for mosh, but not for libpam-tacplus, powerpc-utils,
>> psmisc, ruby, sox, and stunnel...
>>
>> Wouldn't it be better to fix BR2_TOOLCHAIN_HAS_SSP itself instead? Otherwise
>> there isn't much point in having this symbol... So it shouldn't be selected by
>> glibc/musl itself, but by the individual external toolchains. Cfr. the previous
>> discussion for sox [1].
>
> And actually, Vicente already provided a patch for that:
> http://patchwork.ozlabs.org/patch/597701/
Oh, and there is this one as well:
http://patchwork.ozlabs.org/patch/545315/
>
> It is at place fifty-something of my patches-to-review list :-)
... at place sixty-something :-)
Regards,
Arnout
>
> Regards,
> Arnout
>
>>
>> That said, it would of course be a great idea to upstream the patch to mosh so
>> we can remove our workaround at some point.
>>
>> Regards,
>> Arnout
>>
>> [1] http://patchwork.ozlabs.org/patch/590047/
>>
>>>
>>> Signed-off-by: Baruch Siach<baruch@tkos.co.il>
>>> ---
>>> ...ure.ac-link-test-for-fstack-protector-all.patch | 33 ++++++++++++++++++++++
>>> package/mosh/mosh.mk | 11 ++------
>>> 2 files changed, 35 insertions(+), 9 deletions(-)
>>> create mode 100644
>>> package/mosh/0001-configure.ac-link-test-for-fstack-protector-all.patch
>>
>>
>
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] mosh: fix build with the Codescape IMG toolchain
2016-04-05 21:47 ` Arnout Vandecappelle
2016-04-05 23:08 ` Arnout Vandecappelle
@ 2016-04-06 3:27 ` Baruch Siach
1 sibling, 0 replies; 6+ messages in thread
From: Baruch Siach @ 2016-04-06 3:27 UTC (permalink / raw)
To: buildroot
Hi Arnout,
On Tue, Apr 05, 2016 at 11:47:45PM +0200, Arnout Vandecappelle wrote:
> On 04/05/16 20:03, Baruch Siach wrote:
> >The Codescape IMG toolchain does not provide the ssp library even though it's
> >a glibc toolchain, and thus selects BR2_TOOLCHAIN_HAS_SSP. Add a patch that
> >changes the compile test for -fstack-protector-all to a build test that
> >correctly fails when ssp is missing.
> >
> >This makes the seeding of ssp related configure variables unnecessary.
>
> So, this fixes the issue for mosh, but not for libpam-tacplus,
> powerpc-utils, psmisc, ruby, sox, and stunnel...
>
> Wouldn't it be better to fix BR2_TOOLCHAIN_HAS_SSP itself instead?
> Otherwise there isn't much point in having this symbol... So it shouldn't be
> selected by glibc/musl itself, but by the individual external toolchains.
> Cfr. the previous discussion for sox [1].
>
> That said, it would of course be a great idea to upstream the patch to mosh
> so we can remove our workaround at some point.
Upstream status of the mosh patch is at
https://github.com/mobile-shell/mosh/pull/744.
> [1] http://patchwork.ozlabs.org/patch/590047/
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-04-06 3:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-05 18:03 [Buildroot] [PATCH] mosh: fix build with the Codescape IMG toolchain Baruch Siach
2016-04-05 20:25 ` Baruch Siach
2016-04-05 21:47 ` Arnout Vandecappelle
2016-04-05 23:08 ` Arnout Vandecappelle
2016-04-05 23:23 ` Arnout Vandecappelle
2016-04-06 3:27 ` Baruch Siach
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox