All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/2] package/libtomcrypt: add pkgconfig support
@ 2021-05-02 10:50 Peter Seiderer
  2021-05-02 10:50 ` [Buildroot] [PATCH v2 2/2] package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables Peter Seiderer
  2021-05-04 20:18 ` [Buildroot] [PATCH v2 1/2] package/libtomcrypt: add pkgconfig support Arnout Vandecappelle
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Seiderer @ 2021-05-02 10:50 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v1 -> v2:
  - use libtomcrypt provided libtomcrypt.pc.in template file
---
 package/libtomcrypt/libtomcrypt.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/libtomcrypt/libtomcrypt.mk b/package/libtomcrypt/libtomcrypt.mk
index fccd4b051c..3d166a6854 100644
--- a/package/libtomcrypt/libtomcrypt.mk
+++ b/package/libtomcrypt/libtomcrypt.mk
@@ -27,6 +27,10 @@ define LIBTOMCRYPT_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" \
 		PREFIX=/usr NODOCS=1 INSTALL_USER=$(shell id -u) \
 		INSTALL_GROUP=$(shell id -g) install
+	sed -e 's,^prefix=.*,prefix=/usr,' \
+		-e 's,^Version:.*,Version: $(LIBTOMCRYPT_VERSION),' \
+		$(@D)/libtomcrypt.pc.in \
+		> $(STAGING_DIR)/usr/lib/pkgconfig/libtomcrypt.pc
 endef
 
 $(eval $(generic-package))
-- 
2.31.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables
  2021-05-02 10:50 [Buildroot] [PATCH v2 1/2] package/libtomcrypt: add pkgconfig support Peter Seiderer
@ 2021-05-02 10:50 ` Peter Seiderer
  2021-05-04 20:17   ` Arnout Vandecappelle
  2021-05-08  9:35   ` Peter Korsgaard
  2021-05-04 20:18 ` [Buildroot] [PATCH v2 1/2] package/libtomcrypt: add pkgconfig support Arnout Vandecappelle
  1 sibling, 2 replies; 6+ messages in thread
From: Peter Seiderer @ 2021-05-02 10:50 UTC (permalink / raw)
  To: buildroot

Fixes:

  .../x86_64-buildroot-linux-gnu/bin/ld: .../host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libtomcrypt.a(md5.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v1 -> v2:
  - add -fPIC only for non static builds (suggested by Arnout Vandecappelle)
---
 package/libtomcrypt/libtomcrypt.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/libtomcrypt/libtomcrypt.mk b/package/libtomcrypt/libtomcrypt.mk
index 3d166a6854..d1cf552abd 100644
--- a/package/libtomcrypt/libtomcrypt.mk
+++ b/package/libtomcrypt/libtomcrypt.mk
@@ -19,6 +19,10 @@ LIBTOMCRYPT_IGNORE_CVES += CVE-2019-17362
 
 LIBTOMCRYPT_CFLAGS = -I./src/headers $(TARGET_CFLAGS) -DLTC_SOURCE -DLTM_DESC
 
+ifeq ($(BR2_STATIC_LIBS),)
+LIBTOMCRYPT_CFLAGS += -fPIC
+endif
+
 define LIBTOMCRYPT_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(LIBTOMCRYPT_CFLAGS)"
 endef
-- 
2.31.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables
  2021-05-02 10:50 ` [Buildroot] [PATCH v2 2/2] package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables Peter Seiderer
@ 2021-05-04 20:17   ` Arnout Vandecappelle
  2021-05-08  9:35   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2021-05-04 20:17 UTC (permalink / raw)
  To: buildroot



On 02/05/2021 12:50, Peter Seiderer wrote:
> Fixes:
> 
>   .../x86_64-buildroot-linux-gnu/bin/ld: .../host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libtomcrypt.a(md5.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>

 Applied to master, thanks.

 Regards,
 Arnout

> ---
> Changes v1 -> v2:
>   - add -fPIC only for non static builds (suggested by Arnout Vandecappelle)
> ---
>  package/libtomcrypt/libtomcrypt.mk | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/package/libtomcrypt/libtomcrypt.mk b/package/libtomcrypt/libtomcrypt.mk
> index 3d166a6854..d1cf552abd 100644
> --- a/package/libtomcrypt/libtomcrypt.mk
> +++ b/package/libtomcrypt/libtomcrypt.mk
> @@ -19,6 +19,10 @@ LIBTOMCRYPT_IGNORE_CVES += CVE-2019-17362
>  
>  LIBTOMCRYPT_CFLAGS = -I./src/headers $(TARGET_CFLAGS) -DLTC_SOURCE -DLTM_DESC
>  
> +ifeq ($(BR2_STATIC_LIBS),)
> +LIBTOMCRYPT_CFLAGS += -fPIC
> +endif
> +
>  define LIBTOMCRYPT_BUILD_CMDS
>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(LIBTOMCRYPT_CFLAGS)"
>  endef
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/libtomcrypt: add pkgconfig support
  2021-05-02 10:50 [Buildroot] [PATCH v2 1/2] package/libtomcrypt: add pkgconfig support Peter Seiderer
  2021-05-02 10:50 ` [Buildroot] [PATCH v2 2/2] package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables Peter Seiderer
@ 2021-05-04 20:18 ` Arnout Vandecappelle
  2021-05-06 20:16   ` Peter Seiderer
  1 sibling, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2021-05-04 20:18 UTC (permalink / raw)
  To: buildroot



On 02/05/2021 12:50, Peter Seiderer wrote:
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v1 -> v2:
>   - use libtomcrypt provided libtomcrypt.pc.in template file
> ---
>  package/libtomcrypt/libtomcrypt.mk | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/package/libtomcrypt/libtomcrypt.mk b/package/libtomcrypt/libtomcrypt.mk
> index fccd4b051c..3d166a6854 100644
> --- a/package/libtomcrypt/libtomcrypt.mk
> +++ b/package/libtomcrypt/libtomcrypt.mk
> @@ -27,6 +27,10 @@ define LIBTOMCRYPT_INSTALL_STAGING_CMDS
>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" \
>  		PREFIX=/usr NODOCS=1 INSTALL_USER=$(shell id -u) \
>  		INSTALL_GROUP=$(shell id -g) install
> +	sed -e 's,^prefix=.*,prefix=/usr,' \
> +		-e 's,^Version:.*,Version: $(LIBTOMCRYPT_VERSION),' \
> +		$(@D)/libtomcrypt.pc.in \
> +		> $(STAGING_DIR)/usr/lib/pkgconfig/libtomcrypt.pc

 What about the option of using makefile.unix so we don't have to do this ourselves?

 I've kept the patch as New in patchwork in case you don't see that as feasible.

 Regards,
 Arnout

>  endef
>  
>  $(eval $(generic-package))
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/libtomcrypt: add pkgconfig support
  2021-05-04 20:18 ` [Buildroot] [PATCH v2 1/2] package/libtomcrypt: add pkgconfig support Arnout Vandecappelle
@ 2021-05-06 20:16   ` Peter Seiderer
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Seiderer @ 2021-05-06 20:16 UTC (permalink / raw)
  To: buildroot

Hello Arnout,

On Tue, 4 May 2021 22:18:53 +0200, Arnout Vandecappelle <arnout@mind.be> wrote:

> On 02/05/2021 12:50, Peter Seiderer wrote:
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > ---
> > Changes v1 -> v2:
> >   - use libtomcrypt provided libtomcrypt.pc.in template file
> > ---
> >  package/libtomcrypt/libtomcrypt.mk | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/package/libtomcrypt/libtomcrypt.mk b/package/libtomcrypt/libtomcrypt.mk
> > index fccd4b051c..3d166a6854 100644
> > --- a/package/libtomcrypt/libtomcrypt.mk
> > +++ b/package/libtomcrypt/libtomcrypt.mk
> > @@ -27,6 +27,10 @@ define LIBTOMCRYPT_INSTALL_STAGING_CMDS
> >  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" \
> >  		PREFIX=/usr NODOCS=1 INSTALL_USER=$(shell id -u) \
> >  		INSTALL_GROUP=$(shell id -g) install
> > +	sed -e 's,^prefix=.*,prefix=/usr,' \
> > +		-e 's,^Version:.*,Version: $(LIBTOMCRYPT_VERSION),' \
> > +		$(@D)/libtomcrypt.pc.in \
> > +		> $(STAGING_DIR)/usr/lib/pkgconfig/libtomcrypt.pc
>
>  What about the option of using makefile.unix so we don't have to do this ourselves?
>

Quick compare (with additional line breaks):

- makefile:

.../host/bin/x86_64-buildroot-linux-gnu-gcc
	-I./src/headers/
	-Wall -Wsign-compare -Wshadow
	-DLTC_SOURCE
	-Wextra -Wsystem-headers -Wbad-function-cast -Wcast-align -Wstrict-prototypes
	-Wpointer-arith -Wdeclaration-after-statement -Wwrite-strings -Wno-type-limits
	-O3 -funroll-loops -fomit-frame-pointer -DGIT_VERSION=\"1.18.2\"
	-I./src/headers -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
	-Os -g2  -DLTC_SOURCE -DLTM_DESC -fPIC -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes.o


- makefile.unix:

.../host/bin/x86_64-buildroot-linux-gnu-gcc
	-Isrc/headers -Itests -DLTC_SOURCE
	-I./src/headers -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
	-Os -g2  -DLTC_SOURCE -DLTM_DESC -fPIC -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes.o

Seems to cut down a lot of warning flags (and an overwritten optimize flag), but
seems to miss the version define...

>  I've kept the patch as New in patchwork in case you don't see that as feasible.

Will give the makefile.unix a try (and see if the install works as expected)...

Regards,
Peter

>
>  Regards,
>  Arnout
>
> >  endef
> >
> >  $(eval $(generic-package))
> >
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables
  2021-05-02 10:50 ` [Buildroot] [PATCH v2 2/2] package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables Peter Seiderer
  2021-05-04 20:17   ` Arnout Vandecappelle
@ 2021-05-08  9:35   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2021-05-08  9:35 UTC (permalink / raw)
  To: buildroot

>>>>> "Peter" == Peter Seiderer <ps.report@gmx.net> writes:

 > Fixes:
 >   .../x86_64-buildroot-linux-gnu/bin/ld: .../host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libtomcrypt.a(md5.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

 > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
 > ---
 > Changes v1 -> v2:
 >   - add -fPIC only for non static builds (suggested by Arnout Vandecappelle)

Committed to 2021.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-08  9:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-02 10:50 [Buildroot] [PATCH v2 1/2] package/libtomcrypt: add pkgconfig support Peter Seiderer
2021-05-02 10:50 ` [Buildroot] [PATCH v2 2/2] package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables Peter Seiderer
2021-05-04 20:17   ` Arnout Vandecappelle
2021-05-08  9:35   ` Peter Korsgaard
2021-05-04 20:18 ` [Buildroot] [PATCH v2 1/2] package/libtomcrypt: add pkgconfig support Arnout Vandecappelle
2021-05-06 20:16   ` Peter Seiderer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.