From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/jpeg-turbo: force fPIC for shared libraries
Date: Sat, 22 Feb 2020 19:31:27 +0100 [thread overview]
Message-ID: <20200222183127.GH17342@scaer> (raw)
In-Reply-To: <20200222181040.375497-1-romain.naour@gmail.com>
Romain, All,
On 2020-02-22 19:10 +0100, Romain Naour spake thusly:
> When BR2_SSP_ALL is set, there is a link issue due to missing -fPIC in CFLAGS.
> Set CMAKE_POSITION_INDEPENDENT_CODE=ON to add it.
>
> This is a similar fix as for gtest package [1]
>
> [1] https://git.buildroot.net/buildroot/commit/?id=2026621f3c60167aa8ba48e658be1b214d1347d7
>
> Fixes:
> http://autobuild.buildroot.net/results/e1f/e1f164cee16b037c0232fdda40fc16caf8f0c0af
>
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Murat Demirten <mdemirten@yh.com.tr>
Applied to master, thanks.
However, one question below...
> ---
> package/jpeg-turbo/jpeg-turbo.mk | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/package/jpeg-turbo/jpeg-turbo.mk b/package/jpeg-turbo/jpeg-turbo.mk
> index 2767ce6de4..126b470630 100644
> --- a/package/jpeg-turbo/jpeg-turbo.mk
> +++ b/package/jpeg-turbo/jpeg-turbo.mk
> @@ -31,6 +31,16 @@ else
> JPEG_TURBO_CONF_OPTS += -DWITH_SIMD=OFF
> endif
>
> +# Ensure that jpeg-turbo is compiled with -fPIC to allow linking the static
> +# libraries with dynamically linked programs. This is not a requirement
> +# for most architectures but is mandatory for ARM.
> +# This allow to avoid link issues with BR2_SSP_ALL:
> +# jsimd_none.c.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17'
> +# can not be used when making a shared object; recompile with -fPIC
> +ifeq ($(BR2_STATIC_LIBS),)
> +JPEG_TURBO_CONF_OPTS += -DCMAKE_POSITION_INDEPENDENT_CODE=ON
> +endif
Should we not be doing that in the pkg-cmake infra instead?
Regards,
Yann E. MORIN.
> +
> define JPEG_TURBO_REMOVE_USELESS_TOOLS
> rm -f $(addprefix $(TARGET_DIR)/usr/bin/,cjpeg djpeg jpegtran rdjpgcom tjbench wrjpgcom)
> endef
> --
> 2.24.1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2020-02-22 18:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-22 18:10 [Buildroot] [PATCH] package/jpeg-turbo: force fPIC for shared libraries Romain Naour
2020-02-22 18:31 ` Yann E. MORIN [this message]
2020-02-22 18:36 ` Romain Naour
2020-03-14 14:16 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200222183127.GH17342@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox