Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] libtool: patch the libtool script for native envs when cross
@ 2019-06-30 16:17 voidlinux-github
  2019-06-30 16:19 ` voidlinux-github
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: voidlinux-github @ 2019-06-30 16:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

There is a new pull request by q66 against master on the void-packages repository

https://github.com/void-power/void-packages libtool
https://github.com/void-linux/void-packages/pull/12759

libtool: patch the libtool script for native envs when cross
When libtool is cross compiled, it introduces assumptions about the cross toolchain into the resulting /usr/bin/libtool script, which prevents the script from working when used on the target machine in a "native" environment.

The reason for this is primarily that the "short triplet" versions of the binutils tools do not exist in the target system, only in the crosstoolchain. Even if they did though, this would still be wrong.

This impacts some real packages, for example libtommath does not build when built natively in an environment for which libtool was cross compiled.

A patch file from https://github.com/void-linux/void-packages/pull/12759.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libtool-12759.patch --]
[-- Type: application/text/x-diff, Size: 2365 bytes --]

From 4821dbf8c7ed4303320430e8b803bee60965ae5a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 30 Jun 2019 18:14:58 +0200
Subject: [PATCH] libtool: patch the libtool script for native envs when cross

When libtool is cross compiled, it introduces assumptions about
the cross toolchain into the resulting /usr/bin/libtool script,
which prevents the script from working when used on the target
machine in a "native" environment.

The reason for this is primarily that the "short triplet" versions
of the binutils tools do not exist in the target system, only in
the crosstoolchain. Even if they did though, this would still be
wrong.

This impacts some real packages, for example libtommath does not
build when built natively in an environment for which libtool was
cross compiled.
---
 srcpkgs/libtool/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index 4d7687ab7a7..d0746e15b4b 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template build file for 'libtool'
 pkgname=libtool
 version=2.4.6
-revision=2
+revision=3
 hostmakedepends="perl automake help2man"
 depends="tar sed"
 build_style=gnu-configure
@@ -17,6 +17,28 @@ pre_configure() {
 	./bootstrap --force
 }
 
+post_install() {
+	# this is necessary, because when cross building, libtool will pick up
+	# the binary names of the crosstoolchain, which are prefixed with the
+	# short triplet (i.e. arch-linux-env instead of arch-unknown-linux-env)
+	# and those are not present in a real native environment; also the
+	# sysroot var will be set and cflags will include extra cross-related
+	# things that need to go; the target libtool script is meant to be used
+	# in native environments, not in cross environments, so patch the script
+	if [ "$CROSS_BUILD" ]; then
+		# e.g. AR="armv7l-linux-gnueabihf-ar" becomes AR="ar"
+		vsed -i -e "s,=\"${XBPS_CROSS_TRIPLET}\-,=\",g" \
+		 ${PKGDESTDIR}/usr/bin/libtool
+
+		# clear out any sysroot present
+		vsed -i -e "s,^lt_sysroot=.*,lt_sysroot=," \
+		 ${PKGDESTDIR}/usr/bin/libtool
+
+		# clear out sysroot include path
+		vsed -i -e "s,\-I${XBPS_CROSS_BASE}/usr/include,,g" \
+		 ${PKGDESTDIR}/usr/bin/libtool
+	fi
+}
 
 libltdl-devel_package() {
 	depends="libltdl-${version}_${revision}"

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

* Re: libtool: patch the libtool script for native envs when cross
  2019-06-30 16:17 [PR PATCH] libtool: patch the libtool script for native envs when cross voidlinux-github
@ 2019-06-30 16:19 ` voidlinux-github
  2019-06-30 16:36 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: voidlinux-github @ 2019-06-30 16:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/12759#issuecomment-507048922
Comment:
I think this might need some more changes, too. Particularly, `build_alias`, `build`, `build_os` should be the same as `host_alias`, `host`, `host_os` which i am not taking care of right now...

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

* Re: [PR PATCH] [Updated] libtool: patch the libtool script for native envs when cross
  2019-06-30 16:17 [PR PATCH] libtool: patch the libtool script for native envs when cross voidlinux-github
  2019-06-30 16:19 ` voidlinux-github
  2019-06-30 16:36 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-06-30 16:36 ` voidlinux-github
  2019-06-30 16:36 ` voidlinux-github
  2019-06-30 18:21 ` [PR PATCH] [Merged]: " voidlinux-github
  4 siblings, 0 replies; 6+ messages in thread
From: voidlinux-github @ 2019-06-30 16:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 931 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-power/void-packages libtool
https://github.com/void-linux/void-packages/pull/12759

libtool: patch the libtool script for native envs when cross
When libtool is cross compiled, it introduces assumptions about the cross toolchain into the resulting /usr/bin/libtool script, which prevents the script from working when used on the target machine in a "native" environment.

The reason for this is primarily that the "short triplet" versions of the binutils tools do not exist in the target system, only in the crosstoolchain. Even if they did though, this would still be wrong.

This impacts some real packages, for example libtommath does not build when built natively in an environment for which libtool was cross compiled.

A patch file from https://github.com/void-linux/void-packages/pull/12759.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libtool-12759.patch --]
[-- Type: application/text/x-diff, Size: 3429 bytes --]

From 4fee9ba46d3c4e950b72d66f6337b5e287b28a53 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 30 Jun 2019 18:14:58 +0200
Subject: [PATCH] libtool: patch the libtool script for native envs when cross

When libtool is cross compiled, it introduces assumptions about
the cross toolchain into the resulting /usr/bin/libtool script,
which prevents the script from working when used on the target
machine in a "native" environment.

The reason for this is primarily that the "short triplet" versions
of the binutils tools do not exist in the target system, only in
the crosstoolchain. Even if they did though, this would still be
wrong.

This impacts some real packages, for example libtommath does not
build when built natively in an environment for which libtool was
cross compiled.
---
 srcpkgs/libtool/template | 45 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 40 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index 4d7687ab7a7..6b7b115f5b1 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,15 +1,15 @@
-# Template build file for 'libtool'
+# Template file for 'libtool'
 pkgname=libtool
 version=2.4.6
-revision=2
+revision=3
+build_style=gnu-configure
 hostmakedepends="perl automake help2man"
 depends="tar sed"
-build_style=gnu-configure
-homepage="http://www.gnu.org/software/libtool"
-distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
 short_desc="Generic library support script"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 license="GPL-2"
+homepage="http://www.gnu.org/software/libtool"
+distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
 checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
 
 pre_configure() {
@@ -17,6 +17,41 @@ pre_configure() {
 	./bootstrap --force
 }
 
+post_install() {
+	local _canonical_host _host_os
+
+	# this is necessary, because when cross building, libtool will pick up
+	# the binary names of the crosstoolchain, which are prefixed with the
+	# short triplet (i.e. arch-linux-env instead of arch-unknown-linux-env)
+	# and those are not present in a real native environment; also the
+	# sysroot var will be set and cflags will include extra cross-related
+	# things that need to go; the target libtool script is meant to be used
+	# in native environments, not in cross environments, so patch the script
+	if [ "$CROSS_BUILD" ]; then
+		# e.g. AR="armv7l-linux-gnueabihf-ar" becomes AR="ar"
+		vsed -i -e "s,=\"${XBPS_CROSS_TRIPLET}\-,=\",g" \
+		 ${PKGDESTDIR}/usr/bin/libtool
+
+		# clear out any sysroot present
+		vsed -i -e "s,^lt_sysroot=.*,lt_sysroot=," \
+		 ${PKGDESTDIR}/usr/bin/libtool
+
+		# clear out sysroot include path
+		vsed -i -e "s,\-I${XBPS_CROSS_BASE}/usr/include,,g" \
+		 ${PKGDESTDIR}/usr/bin/libtool
+
+		# canonicalize host_alias, replace build(_alias,_os)
+		_canonical_host=$(grep "^host=" ${PKGDESTDIR}/usr/bin/libtool | sed 's/host=//')
+		_host_os=$(grep "^host_os=" ${PKGDESTDIR}/usr/bin/libtool | sed 's/host_os=//')
+		vsed -i \
+		 -e "s,^host_alias=.*,host_alias=${_canonical_host}," \
+		 -e "s,^host=.*,host=${_canonical_host}," \
+		 -e "s,^build_alias=.*,build_alias=${_canonical_host}," \
+		 -e "s,^build=.*,build=${_canonical_host}," \
+		 -e "s,^build_os=.*,build_os=${_host_os}," \
+		 ${PKGDESTDIR}/usr/bin/libtool
+	fi
+}
 
 libltdl-devel_package() {
 	depends="libltdl-${version}_${revision}"

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

* Re: [PR PATCH] [Updated] libtool: patch the libtool script for native envs when cross
  2019-06-30 16:17 [PR PATCH] libtool: patch the libtool script for native envs when cross voidlinux-github
  2019-06-30 16:19 ` voidlinux-github
@ 2019-06-30 16:36 ` voidlinux-github
  2019-06-30 16:36 ` voidlinux-github
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: voidlinux-github @ 2019-06-30 16:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 931 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-power/void-packages libtool
https://github.com/void-linux/void-packages/pull/12759

libtool: patch the libtool script for native envs when cross
When libtool is cross compiled, it introduces assumptions about the cross toolchain into the resulting /usr/bin/libtool script, which prevents the script from working when used on the target machine in a "native" environment.

The reason for this is primarily that the "short triplet" versions of the binutils tools do not exist in the target system, only in the crosstoolchain. Even if they did though, this would still be wrong.

This impacts some real packages, for example libtommath does not build when built natively in an environment for which libtool was cross compiled.

A patch file from https://github.com/void-linux/void-packages/pull/12759.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libtool-12759.patch --]
[-- Type: application/text/x-diff, Size: 3429 bytes --]

From 4fee9ba46d3c4e950b72d66f6337b5e287b28a53 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 30 Jun 2019 18:14:58 +0200
Subject: [PATCH] libtool: patch the libtool script for native envs when cross

When libtool is cross compiled, it introduces assumptions about
the cross toolchain into the resulting /usr/bin/libtool script,
which prevents the script from working when used on the target
machine in a "native" environment.

The reason for this is primarily that the "short triplet" versions
of the binutils tools do not exist in the target system, only in
the crosstoolchain. Even if they did though, this would still be
wrong.

This impacts some real packages, for example libtommath does not
build when built natively in an environment for which libtool was
cross compiled.
---
 srcpkgs/libtool/template | 45 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 40 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index 4d7687ab7a7..6b7b115f5b1 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,15 +1,15 @@
-# Template build file for 'libtool'
+# Template file for 'libtool'
 pkgname=libtool
 version=2.4.6
-revision=2
+revision=3
+build_style=gnu-configure
 hostmakedepends="perl automake help2man"
 depends="tar sed"
-build_style=gnu-configure
-homepage="http://www.gnu.org/software/libtool"
-distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
 short_desc="Generic library support script"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 license="GPL-2"
+homepage="http://www.gnu.org/software/libtool"
+distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
 checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
 
 pre_configure() {
@@ -17,6 +17,41 @@ pre_configure() {
 	./bootstrap --force
 }
 
+post_install() {
+	local _canonical_host _host_os
+
+	# this is necessary, because when cross building, libtool will pick up
+	# the binary names of the crosstoolchain, which are prefixed with the
+	# short triplet (i.e. arch-linux-env instead of arch-unknown-linux-env)
+	# and those are not present in a real native environment; also the
+	# sysroot var will be set and cflags will include extra cross-related
+	# things that need to go; the target libtool script is meant to be used
+	# in native environments, not in cross environments, so patch the script
+	if [ "$CROSS_BUILD" ]; then
+		# e.g. AR="armv7l-linux-gnueabihf-ar" becomes AR="ar"
+		vsed -i -e "s,=\"${XBPS_CROSS_TRIPLET}\-,=\",g" \
+		 ${PKGDESTDIR}/usr/bin/libtool
+
+		# clear out any sysroot present
+		vsed -i -e "s,^lt_sysroot=.*,lt_sysroot=," \
+		 ${PKGDESTDIR}/usr/bin/libtool
+
+		# clear out sysroot include path
+		vsed -i -e "s,\-I${XBPS_CROSS_BASE}/usr/include,,g" \
+		 ${PKGDESTDIR}/usr/bin/libtool
+
+		# canonicalize host_alias, replace build(_alias,_os)
+		_canonical_host=$(grep "^host=" ${PKGDESTDIR}/usr/bin/libtool | sed 's/host=//')
+		_host_os=$(grep "^host_os=" ${PKGDESTDIR}/usr/bin/libtool | sed 's/host_os=//')
+		vsed -i \
+		 -e "s,^host_alias=.*,host_alias=${_canonical_host}," \
+		 -e "s,^host=.*,host=${_canonical_host}," \
+		 -e "s,^build_alias=.*,build_alias=${_canonical_host}," \
+		 -e "s,^build=.*,build=${_canonical_host}," \
+		 -e "s,^build_os=.*,build_os=${_host_os}," \
+		 ${PKGDESTDIR}/usr/bin/libtool
+	fi
+}
 
 libltdl-devel_package() {
 	depends="libltdl-${version}_${revision}"

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

* Re: libtool: patch the libtool script for native envs when cross
  2019-06-30 16:17 [PR PATCH] libtool: patch the libtool script for native envs when cross voidlinux-github
                   ` (2 preceding siblings ...)
  2019-06-30 16:36 ` voidlinux-github
@ 2019-06-30 16:36 ` voidlinux-github
  2019-06-30 18:21 ` [PR PATCH] [Merged]: " voidlinux-github
  4 siblings, 0 replies; 6+ messages in thread
From: voidlinux-github @ 2019-06-30 16:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/12759#issuecomment-507049992
Comment:
fixed lint, made sure to patch the host/build stuff also... now it should be fine i think

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

* Re: [PR PATCH] [Merged]: libtool: patch the libtool script for native envs when cross
  2019-06-30 16:17 [PR PATCH] libtool: patch the libtool script for native envs when cross voidlinux-github
                   ` (3 preceding siblings ...)
  2019-06-30 16:36 ` voidlinux-github
@ 2019-06-30 18:21 ` voidlinux-github
  4 siblings, 0 replies; 6+ messages in thread
From: voidlinux-github @ 2019-06-30 18:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 775 bytes --]

There's a merged pull request on the void-packages repository

libtool: patch the libtool script for native envs when cross
https://github.com/void-linux/void-packages/pull/12759
Description: When libtool is cross compiled, it introduces assumptions about the cross toolchain into the resulting /usr/bin/libtool script, which prevents the script from working when used on the target machine in a "native" environment.

The reason for this is primarily that the "short triplet" versions of the binutils tools do not exist in the target system, only in the crosstoolchain. Even if they did though, this would still be wrong.

This impacts some real packages, for example libtommath does not build when built natively in an environment for which libtool was cross compiled.

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

end of thread, other threads:[~2019-06-30 18:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-30 16:17 [PR PATCH] libtool: patch the libtool script for native envs when cross voidlinux-github
2019-06-30 16:19 ` voidlinux-github
2019-06-30 16:36 ` [PR PATCH] [Updated] " voidlinux-github
2019-06-30 16:36 ` voidlinux-github
2019-06-30 16:36 ` voidlinux-github
2019-06-30 18:21 ` [PR PATCH] [Merged]: " voidlinux-github

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).