* [Buildroot] [PATCH v3 01/14] Move $(HOST_DIR)/usr/$(GNU_TARGET_NAME) one level up.
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
@ 2017-07-04 14:03 ` Arnout Vandecappelle
2017-07-04 14:52 ` Romain Naour
2017-07-04 14:03 ` [Buildroot] [PATCH v3 02/14] Move $(HOST_DIR)/usr/lib to $(HOST_DIR)/lib Arnout Vandecappelle
` (13 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:03 UTC (permalink / raw)
To: buildroot
This is a step towards eliminating $(HOST_DIR)/usr. It allows us to
convert all packages installing things into
$(HOST_DIR)/usr/$(GNU_TARGET_NAME) (i.e., binutils and gcc) without
affecting the rest.
To allow compatibility with packages that still use $(HOST_DIR)/usr as
the prefix, create a symlink from usr/$(GNU_TARGET_NAME) to
../$(GNU_TARGET_NAME).
Note that the symlink creation will break when $(HOST_DIR)/usr/lib
already exists as a directory, i.e. when rebuilding in an existing
output directory. This is necessary: if we don't break it now, the
following commits (which remove the usr part from various variables)
_will_ break it.
Effectively, the usr/ part is removed from $(STAGING_SUBDIR) (and
therefore from $(STAGING_DIR)), so update the definition of that
variable right away.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
Makefile | 2 ++
package/Makefile.in | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index b37171fcf2..a0f9f62771 100644
--- a/Makefile
+++ b/Makefile
@@ -556,6 +556,8 @@ world: target-post-image
$(STAGING_DIR):
@mkdir -p $(STAGING_DIR)
@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
+ @mkdir -p $(HOST_DIR)/usr
+ @ln -snf ../$(GNU_TARGET_NAME) $(HOST_DIR)/usr/$(GNU_TARGET_NAME)
RSYNC_VCS_EXCLUSIONS = \
--exclude .svn --exclude .git --exclude .hg --exclude .bzr \
diff --git a/package/Makefile.in b/package/Makefile.in
index 8087bde999..6b88ac4feb 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -107,7 +107,7 @@ ifeq ($(BR2_arc)$(BR2_ARC_ATOMIC_EXT),yy)
TARGET_ABI += -matomic
endif
-STAGING_SUBDIR = usr/$(GNU_TARGET_NAME)/sysroot
+STAGING_SUBDIR = $(GNU_TARGET_NAME)/sysroot
STAGING_DIR = $(HOST_DIR)/$(STAGING_SUBDIR)
ifeq ($(BR2_OPTIMIZE_0),y)
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 01/14] Move $(HOST_DIR)/usr/$(GNU_TARGET_NAME) one level up.
2017-07-04 14:03 ` [Buildroot] [PATCH v3 01/14] Move $(HOST_DIR)/usr/$(GNU_TARGET_NAME) one level up Arnout Vandecappelle
@ 2017-07-04 14:52 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 14:52 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:03, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> This is a step towards eliminating $(HOST_DIR)/usr. It allows us to
> convert all packages installing things into
> $(HOST_DIR)/usr/$(GNU_TARGET_NAME) (i.e., binutils and gcc) without
> affecting the rest.
>
> To allow compatibility with packages that still use $(HOST_DIR)/usr as
> the prefix, create a symlink from usr/$(GNU_TARGET_NAME) to
> ../$(GNU_TARGET_NAME).
>
> Note that the symlink creation will break when $(HOST_DIR)/usr/lib
> already exists as a directory, i.e. when rebuilding in an existing
> output directory. This is necessary: if we don't break it now, the
> following commits (which remove the usr part from various variables)
> _will_ break it.
>
> Effectively, the usr/ part is removed from $(STAGING_SUBDIR) (and
> therefore from $(STAGING_DIR)), so update the definition of that
> variable right away.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> Makefile | 2 ++
> package/Makefile.in | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index b37171fcf2..a0f9f62771 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -556,6 +556,8 @@ world: target-post-image
> $(STAGING_DIR):
> @mkdir -p $(STAGING_DIR)
> @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
> + @mkdir -p $(HOST_DIR)/usr
> + @ln -snf ../$(GNU_TARGET_NAME) $(HOST_DIR)/usr/$(GNU_TARGET_NAME)
>
> RSYNC_VCS_EXCLUSIONS = \
> --exclude .svn --exclude .git --exclude .hg --exclude .bzr \
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 8087bde999..6b88ac4feb 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -107,7 +107,7 @@ ifeq ($(BR2_arc)$(BR2_ARC_ATOMIC_EXT),yy)
> TARGET_ABI += -matomic
> endif
>
> -STAGING_SUBDIR = usr/$(GNU_TARGET_NAME)/sysroot
> +STAGING_SUBDIR = $(GNU_TARGET_NAME)/sysroot
> STAGING_DIR = $(HOST_DIR)/$(STAGING_SUBDIR)
>
> ifeq ($(BR2_OPTIMIZE_0),y)
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 02/14] Move $(HOST_DIR)/usr/lib to $(HOST_DIR)/lib
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
2017-07-04 14:03 ` [Buildroot] [PATCH v3 01/14] Move $(HOST_DIR)/usr/$(GNU_TARGET_NAME) one level up Arnout Vandecappelle
@ 2017-07-04 14:03 ` Arnout Vandecappelle
2017-07-04 14:55 ` Romain Naour
2017-07-04 14:03 ` [Buildroot] [PATCH v3 03/14] Eliminate $(HOST_DIR)/usr Arnout Vandecappelle
` (12 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:03 UTC (permalink / raw)
To: buildroot
This is a step towards eliminating $(HOST_DIR)/usr. It allows us to
convert all packages installing things into $(HOST_DIR)/usr/lib without
affecting the rest.
To allow compatibility with packages that still use $(HOST_DIR)/usr as
the prefix, create a symlink from usr/lib to ../lib.
Note that the symlink creation will break when $(HOST_DIR)/usr/lib
already exists as a directory, i.e. when rebuilding in an existing
output directory. This is necessary: if we don't break it now, the
following commits (which remove the usr part from various variables)
_will_ break it.
At the same time as creating this symlink, we also have to update the
check-host-rpath to accept both $(HOST_DIR)/usr/lib and $(HOST_DIR)/lib,
because depending on how the package derives the path, it may be
different.
Since there are some dependency chains that involve $(STAGING_DIR),
$(STAGING_DIR) may in fact be created before $(HOST_DIR). Since
$(STAGING_DIR) is a subdirectory of $(HOST_DIR), it is possible that the
newly added rule for $(HOST_DIR) never triggers. To make sure that the
rule does trigger, add an order-only dependency from $(STAGING_DIR) to
$(HOST_DIR).
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
v2: rebase on modifications of check-host-rpath with $ORIGIN.
---
Makefile | 10 +++++++---
support/scripts/check-host-rpath | 8 +++++---
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index a0f9f62771..ac349a79e8 100644
--- a/Makefile
+++ b/Makefile
@@ -237,7 +237,7 @@ LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
# dependencies anywhere else
#
################################################################################
-$(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
+$(BUILD_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
@mkdir -p $@
BR2_CONFIG = $(CONFIG_DIR)/.config
@@ -552,11 +552,15 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
.PHONY: world
world: target-post-image
+# When creating HOST_DIR, also symlink usr/lib -> ../lib
+$(HOST_DIR):
+ @mkdir -p $@/usr $@/lib
+ @ln -snf ../lib $@/usr/lib
+
# Populating the staging with the base directories is handled by the skeleton package
-$(STAGING_DIR):
+$(STAGING_DIR): | $(HOST_DIR)
@mkdir -p $(STAGING_DIR)
@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
- @mkdir -p $(HOST_DIR)/usr
@ln -snf ../$(GNU_TARGET_NAME) $(HOST_DIR)/usr/$(GNU_TARGET_NAME)
RSYNC_VCS_EXCLUSIONS = \
diff --git a/support/scripts/check-host-rpath b/support/scripts/check-host-rpath
index 020c12379f..adabfdf53f 100755
--- a/support/scripts/check-host-rpath
+++ b/support/scripts/check-host-rpath
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
-# This script scans $(HOST_DIR)/{bin,sbin} for all ELF files, and checks
-# they have an RPATH to $(HOST_DIR)/usr/lib if they need libraries from
+# This script scans $(HOST_DIR)/{,usr/}{bin,sbin} for all ELF files, and checks
+# they have an RPATH to $(HOST_DIR)/{,usr/}lib if they need libraries from
# there.
# Override the user's locale so we are sure we can parse the output of
@@ -40,7 +40,7 @@ elf_needs_rpath() {
local lib
while read lib; do
- [ -e "${hostdir}/usr/lib/${lib}" ] && return 0
+ [ -e "${hostdir}/lib/${lib}" ] && return 0
done < <( readelf -d "${file}" \
|sed -r -e '/^.* \(NEEDED\) .*Shared library: \[(.+)\]$/!d;' \
-e 's//\1/;' \
@@ -58,6 +58,8 @@ check_elf_has_rpath() {
for dir in ${rpath//:/ }; do
# Remove duplicate and trailing '/' for proper match
dir="$( sed -r -e 's:/+:/:g; s:/$::;' <<<"${dir}" )"
+ [ "${dir}" = "${hostdir}/lib" -o "${dir}" = "\$ORIGIN/../lib" ] && return 0
+ # For the time being, the rpath is allowed with both usr/lib and lib
[ "${dir}" = "${hostdir}/usr/lib" -o "${dir}" = "\$ORIGIN/../../usr/lib" ] && return 0
done
done < <( readelf -d "${file}" \
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 02/14] Move $(HOST_DIR)/usr/lib to $(HOST_DIR)/lib
2017-07-04 14:03 ` [Buildroot] [PATCH v3 02/14] Move $(HOST_DIR)/usr/lib to $(HOST_DIR)/lib Arnout Vandecappelle
@ 2017-07-04 14:55 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 14:55 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:03, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> This is a step towards eliminating $(HOST_DIR)/usr. It allows us to
> convert all packages installing things into $(HOST_DIR)/usr/lib without
> affecting the rest.
>
> To allow compatibility with packages that still use $(HOST_DIR)/usr as
> the prefix, create a symlink from usr/lib to ../lib.
>
> Note that the symlink creation will break when $(HOST_DIR)/usr/lib
> already exists as a directory, i.e. when rebuilding in an existing
> output directory. This is necessary: if we don't break it now, the
> following commits (which remove the usr part from various variables)
> _will_ break it.
>
> At the same time as creating this symlink, we also have to update the
> check-host-rpath to accept both $(HOST_DIR)/usr/lib and $(HOST_DIR)/lib,
> because depending on how the package derives the path, it may be
> different.
>
> Since there are some dependency chains that involve $(STAGING_DIR),
> $(STAGING_DIR) may in fact be created before $(HOST_DIR). Since
> $(STAGING_DIR) is a subdirectory of $(HOST_DIR), it is possible that the
> newly added rule for $(HOST_DIR) never triggers. To make sure that the
> rule does trigger, add an order-only dependency from $(STAGING_DIR) to
> $(HOST_DIR).
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> v2: rebase on modifications of check-host-rpath with $ORIGIN.
> ---
> Makefile | 10 +++++++---
> support/scripts/check-host-rpath | 8 +++++---
> 2 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index a0f9f62771..ac349a79e8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -237,7 +237,7 @@ LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
> # dependencies anywhere else
> #
> ################################################################################
> -$(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
> +$(BUILD_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
> @mkdir -p $@
>
> BR2_CONFIG = $(CONFIG_DIR)/.config
> @@ -552,11 +552,15 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
> .PHONY: world
> world: target-post-image
>
> +# When creating HOST_DIR, also symlink usr/lib -> ../lib
> +$(HOST_DIR):
> + @mkdir -p $@/usr $@/lib
> + @ln -snf ../lib $@/usr/lib
> +
> # Populating the staging with the base directories is handled by the skeleton package
> -$(STAGING_DIR):
> +$(STAGING_DIR): | $(HOST_DIR)
> @mkdir -p $(STAGING_DIR)
> @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
> - @mkdir -p $(HOST_DIR)/usr
> @ln -snf ../$(GNU_TARGET_NAME) $(HOST_DIR)/usr/$(GNU_TARGET_NAME)
>
> RSYNC_VCS_EXCLUSIONS = \
> diff --git a/support/scripts/check-host-rpath b/support/scripts/check-host-rpath
> index 020c12379f..adabfdf53f 100755
> --- a/support/scripts/check-host-rpath
> +++ b/support/scripts/check-host-rpath
> @@ -1,7 +1,7 @@
> #!/usr/bin/env bash
>
> -# This script scans $(HOST_DIR)/{bin,sbin} for all ELF files, and checks
> -# they have an RPATH to $(HOST_DIR)/usr/lib if they need libraries from
> +# This script scans $(HOST_DIR)/{,usr/}{bin,sbin} for all ELF files, and checks
> +# they have an RPATH to $(HOST_DIR)/{,usr/}lib if they need libraries from
> # there.
>
> # Override the user's locale so we are sure we can parse the output of
> @@ -40,7 +40,7 @@ elf_needs_rpath() {
> local lib
>
> while read lib; do
> - [ -e "${hostdir}/usr/lib/${lib}" ] && return 0
> + [ -e "${hostdir}/lib/${lib}" ] && return 0
> done < <( readelf -d "${file}" \
> |sed -r -e '/^.* \(NEEDED\) .*Shared library: \[(.+)\]$/!d;' \
> -e 's//\1/;' \
> @@ -58,6 +58,8 @@ check_elf_has_rpath() {
> for dir in ${rpath//:/ }; do
> # Remove duplicate and trailing '/' for proper match
> dir="$( sed -r -e 's:/+:/:g; s:/$::;' <<<"${dir}" )"
> + [ "${dir}" = "${hostdir}/lib" -o "${dir}" = "\$ORIGIN/../lib" ] && return 0
> + # For the time being, the rpath is allowed with both usr/lib and lib
> [ "${dir}" = "${hostdir}/usr/lib" -o "${dir}" = "\$ORIGIN/../../usr/lib" ] && return 0
> done
> done < <( readelf -d "${file}" \
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 03/14] Eliminate $(HOST_DIR)/usr
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
2017-07-04 14:03 ` [Buildroot] [PATCH v3 01/14] Move $(HOST_DIR)/usr/$(GNU_TARGET_NAME) one level up Arnout Vandecappelle
2017-07-04 14:03 ` [Buildroot] [PATCH v3 02/14] Move $(HOST_DIR)/usr/lib to $(HOST_DIR)/lib Arnout Vandecappelle
@ 2017-07-04 14:03 ` Arnout Vandecappelle
2017-07-04 15:01 ` Romain Naour
2017-07-04 14:03 ` [Buildroot] [PATCH v3 04/14] check-host-rpath: no longer check $(HOST_DIR)/usr/{bin, sbin} Arnout Vandecappelle
` (11 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:03 UTC (permalink / raw)
To: buildroot
We currently use $(HOST_DIR)/usr as the prefix for host packages. That
has a few disadvantages:
- There are some things installed in $(HOST_DIR)/etc and
$(HOST_DIR)/sbin, which is inconsistent.
- To pack a buildroot-built toolchain into a tarball for use as an
external toolchain, you have to pack output/host/usr instead of the
more obvious output/host.
- Because of the above, the internal toolchain wrapper breaks which
forces us to work around it (call the actual toolchain executable
directly). This is OK for us, but when used in another build system,
that's a problem.
- Paths are four characters longer.
To allow us to gradually eliminate $(HOST_DIR)/usr while building
packages, replace it with a symlink to .
The symlinks from $(HOST_DIR)/usr/$(GNU_TARGET_NAME) and
$(HOST_DIR)/usr/lib that were added previously are removed again.
Note that the symlink creation will break when $(HOST_DIR)/usr
already exists as a directory, i.e. when rebuilding in an existing
output directory. This is necessary: if we don't break it now, the
following commits (which remove the usr part from various variables)
_will_ break it.
At the same time as creating this symlink, we have to update the
external toolchain wrapper and the external toolchain symlinks to go
one directory less up. Indeed, $(HOST_DIR) is one level less up than
it was before.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
I intended to also move $(HOST_DIR)/usr/bin in a separate patch, but
that turns out to break the internal toolchain: host-gcc-initial uses
relative paths to find cc1 etc. and these will be broken.
---
Makefile | 7 +++----
toolchain/toolchain-external/pkg-toolchain-external.mk | 6 +++---
toolchain/toolchain-wrapper.c | 2 +-
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index ac349a79e8..7453bfd193 100644
--- a/Makefile
+++ b/Makefile
@@ -552,16 +552,15 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
.PHONY: world
world: target-post-image
-# When creating HOST_DIR, also symlink usr/lib -> ../lib
+# When creating HOST_DIR, also symlink usr -> .
$(HOST_DIR):
- @mkdir -p $@/usr $@/lib
- @ln -snf ../lib $@/usr/lib
+ @mkdir -p $@
+ @ln -snf . $@/usr
# Populating the staging with the base directories is handled by the skeleton package
$(STAGING_DIR): | $(HOST_DIR)
@mkdir -p $(STAGING_DIR)
@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
- @ln -snf ../$(GNU_TARGET_NAME) $(HOST_DIR)/usr/$(GNU_TARGET_NAME)
RSYNC_VCS_EXCLUSIONS = \
--exclude .svn --exclude .git --exclude .hg --exclude .bzr \
diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index 8460e37d09..adbd3fe67e 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -250,18 +250,18 @@ define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
base=$${i##*/}; \
case "$$base" in \
*-ar|*-ranlib|*-nm) \
- ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+ ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
;; \
*cc|*cc-*|*++|*++-*|*cpp|*-gfortran) \
ln -sf toolchain-wrapper $$base; \
;; \
*gdb|*gdbtui) \
if test "$(BR2_PACKAGE_HOST_GDB)" != "y"; then \
- ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+ ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
fi \
;; \
*) \
- ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+ ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
;; \
esac; \
done
diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
index 100aa181c6..3a4455ff82 100644
--- a/toolchain/toolchain-wrapper.c
+++ b/toolchain/toolchain-wrapper.c
@@ -178,7 +178,7 @@ int main(int argc, char **argv)
perror(__FILE__ ": malloc");
return 2;
}
- sprintf(relbasedir, "%s/../..", argv[0]);
+ sprintf(relbasedir, "%s/..", argv[0]);
absbasedir = realpath(relbasedir, NULL);
} else {
basename = progpath;
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 03/14] Eliminate $(HOST_DIR)/usr
2017-07-04 14:03 ` [Buildroot] [PATCH v3 03/14] Eliminate $(HOST_DIR)/usr Arnout Vandecappelle
@ 2017-07-04 15:01 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:01 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:03, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> We currently use $(HOST_DIR)/usr as the prefix for host packages. That
> has a few disadvantages:
>
> - There are some things installed in $(HOST_DIR)/etc and
> $(HOST_DIR)/sbin, which is inconsistent.
>
> - To pack a buildroot-built toolchain into a tarball for use as an
> external toolchain, you have to pack output/host/usr instead of the
> more obvious output/host.
>
> - Because of the above, the internal toolchain wrapper breaks which
> forces us to work around it (call the actual toolchain executable
> directly). This is OK for us, but when used in another build system,
> that's a problem.
>
> - Paths are four characters longer.
>
> To allow us to gradually eliminate $(HOST_DIR)/usr while building
> packages, replace it with a symlink to .
>
> The symlinks from $(HOST_DIR)/usr/$(GNU_TARGET_NAME) and
> $(HOST_DIR)/usr/lib that were added previously are removed again.
>
> Note that the symlink creation will break when $(HOST_DIR)/usr
> already exists as a directory, i.e. when rebuilding in an existing
> output directory. This is necessary: if we don't break it now, the
> following commits (which remove the usr part from various variables)
> _will_ break it.
>
> At the same time as creating this symlink, we have to update the
> external toolchain wrapper and the external toolchain symlinks to go
> one directory less up. Indeed, $(HOST_DIR) is one level less up than
> it was before.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> I intended to also move $(HOST_DIR)/usr/bin in a separate patch, but
> that turns out to break the internal toolchain: host-gcc-initial uses
> relative paths to find cc1 etc. and these will be broken.
> ---
> Makefile | 7 +++----
> toolchain/toolchain-external/pkg-toolchain-external.mk | 6 +++---
> toolchain/toolchain-wrapper.c | 2 +-
> 3 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index ac349a79e8..7453bfd193 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -552,16 +552,15 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
> .PHONY: world
> world: target-post-image
>
> -# When creating HOST_DIR, also symlink usr/lib -> ../lib
> +# When creating HOST_DIR, also symlink usr -> .
> $(HOST_DIR):
> - @mkdir -p $@/usr $@/lib
> - @ln -snf ../lib $@/usr/lib
> + @mkdir -p $@
> + @ln -snf . $@/usr
>
> # Populating the staging with the base directories is handled by the skeleton package
> $(STAGING_DIR): | $(HOST_DIR)
> @mkdir -p $(STAGING_DIR)
> @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
> - @ln -snf ../$(GNU_TARGET_NAME) $(HOST_DIR)/usr/$(GNU_TARGET_NAME)
>
> RSYNC_VCS_EXCLUSIONS = \
> --exclude .svn --exclude .git --exclude .hg --exclude .bzr \
> diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
> index 8460e37d09..adbd3fe67e 100644
> --- a/toolchain/toolchain-external/pkg-toolchain-external.mk
> +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
> @@ -250,18 +250,18 @@ define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
> base=$${i##*/}; \
> case "$$base" in \
> *-ar|*-ranlib|*-nm) \
> - ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
> + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
> ;; \
> *cc|*cc-*|*++|*++-*|*cpp|*-gfortran) \
> ln -sf toolchain-wrapper $$base; \
> ;; \
> *gdb|*gdbtui) \
> if test "$(BR2_PACKAGE_HOST_GDB)" != "y"; then \
> - ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
> + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
> fi \
> ;; \
> *) \
> - ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
> + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
> ;; \
> esac; \
> done
> diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
> index 100aa181c6..3a4455ff82 100644
> --- a/toolchain/toolchain-wrapper.c
> +++ b/toolchain/toolchain-wrapper.c
> @@ -178,7 +178,7 @@ int main(int argc, char **argv)
> perror(__FILE__ ": malloc");
> return 2;
> }
> - sprintf(relbasedir, "%s/../..", argv[0]);
> + sprintf(relbasedir, "%s/..", argv[0]);
> absbasedir = realpath(relbasedir, NULL);
> } else {
> basename = progpath;
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 04/14] check-host-rpath: no longer check $(HOST_DIR)/usr/{bin, sbin}
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (2 preceding siblings ...)
2017-07-04 14:03 ` [Buildroot] [PATCH v3 03/14] Eliminate $(HOST_DIR)/usr Arnout Vandecappelle
@ 2017-07-04 14:03 ` Arnout Vandecappelle
2017-07-04 15:02 ` Romain Naour
2017-07-04 14:03 ` [Buildroot] [PATCH v3 05/14] Makefile: remove $(HOST_DIR)/usr from BR_PATH Arnout Vandecappelle
` (10 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:03 UTC (permalink / raw)
To: buildroot
Since $(HOST_DIR)/usr/{bin,sbin} are now symlinks to
$(HOST_DIR)/{bin,sbin}, it makes no sense to check them - they are
already covered.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
support/scripts/check-host-rpath | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/support/scripts/check-host-rpath b/support/scripts/check-host-rpath
index adabfdf53f..2846d5eb51 100755
--- a/support/scripts/check-host-rpath
+++ b/support/scripts/check-host-rpath
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# This script scans $(HOST_DIR)/{,usr/}{bin,sbin} for all ELF files, and checks
+# This script scans $(HOST_DIR)/{bin,sbin} for all ELF files, and checks
# they have an RPATH to $(HOST_DIR)/{,usr/}lib if they need libraries from
# there.
@@ -26,7 +26,7 @@ main() {
printf "*** ERROR: package %s installs executables without proper RPATH:\n" "${pkg}"
fi
printf "*** %s\n" "${file}"
- done < <( find "${hostdir}"/{,usr/}{bin,sbin} -type f -exec file {} + 2>/dev/null \
+ done < <( find "${hostdir}"/{bin,sbin} -type f -exec file {} + 2>/dev/null \
|sed -r -e '/^([^:]+):.*\<ELF\>.*\<executable\>.*/!d' \
-e 's//\1/' \
)
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 04/14] check-host-rpath: no longer check $(HOST_DIR)/usr/{bin, sbin}
2017-07-04 14:03 ` [Buildroot] [PATCH v3 04/14] check-host-rpath: no longer check $(HOST_DIR)/usr/{bin, sbin} Arnout Vandecappelle
@ 2017-07-04 15:02 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:02 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:03, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Since $(HOST_DIR)/usr/{bin,sbin} are now symlinks to
> $(HOST_DIR)/{bin,sbin}, it makes no sense to check them - they are
> already covered.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> support/scripts/check-host-rpath | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/support/scripts/check-host-rpath b/support/scripts/check-host-rpath
> index adabfdf53f..2846d5eb51 100755
> --- a/support/scripts/check-host-rpath
> +++ b/support/scripts/check-host-rpath
> @@ -1,6 +1,6 @@
> #!/usr/bin/env bash
>
> -# This script scans $(HOST_DIR)/{,usr/}{bin,sbin} for all ELF files, and checks
> +# This script scans $(HOST_DIR)/{bin,sbin} for all ELF files, and checks
> # they have an RPATH to $(HOST_DIR)/{,usr/}lib if they need libraries from
> # there.
>
> @@ -26,7 +26,7 @@ main() {
> printf "*** ERROR: package %s installs executables without proper RPATH:\n" "${pkg}"
> fi
> printf "*** %s\n" "${file}"
> - done < <( find "${hostdir}"/{,usr/}{bin,sbin} -type f -exec file {} + 2>/dev/null \
> + done < <( find "${hostdir}"/{bin,sbin} -type f -exec file {} + 2>/dev/null \
> |sed -r -e '/^([^:]+):.*\<ELF\>.*\<executable\>.*/!d' \
> -e 's//\1/' \
> )
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 05/14] Makefile: remove $(HOST_DIR)/usr from BR_PATH
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (3 preceding siblings ...)
2017-07-04 14:03 ` [Buildroot] [PATCH v3 04/14] check-host-rpath: no longer check $(HOST_DIR)/usr/{bin, sbin} Arnout Vandecappelle
@ 2017-07-04 14:03 ` Arnout Vandecappelle
2017-07-04 15:03 ` Romain Naour
2017-07-04 14:03 ` [Buildroot] [PATCH v3 06/14] package/Makefile.in: remove $(HOST_DIR)/usr part from HOST_LDFLAGS Arnout Vandecappelle
` (9 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:03 UTC (permalink / raw)
To: buildroot
Now $(HOST_DIR)/usr is a symlink to $(HOST_DIR), it makes no sense to
still have it in BR_PATH.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 7453bfd193..19d8b442a3 100644
--- a/Makefile
+++ b/Makefile
@@ -440,7 +440,7 @@ TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf
HOST_DIR := $(call qstrip,$(BR2_HOST_DIR))
# Quotes are needed for spaces and all in the original PATH content.
-BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin:$(PATH)"
+BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"
# Location of a file giving a big fat warning that output/target
# should not be used as the root filesystem.
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 05/14] Makefile: remove $(HOST_DIR)/usr from BR_PATH
2017-07-04 14:03 ` [Buildroot] [PATCH v3 05/14] Makefile: remove $(HOST_DIR)/usr from BR_PATH Arnout Vandecappelle
@ 2017-07-04 15:03 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:03 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:03, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Now $(HOST_DIR)/usr is a symlink to $(HOST_DIR), it makes no sense to
> still have it in BR_PATH.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 7453bfd193..19d8b442a3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -440,7 +440,7 @@ TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf
> HOST_DIR := $(call qstrip,$(BR2_HOST_DIR))
>
> # Quotes are needed for spaces and all in the original PATH content.
> -BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin:$(PATH)"
> +BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"
>
> # Location of a file giving a big fat warning that output/target
> # should not be used as the root filesystem.
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 06/14] package/Makefile.in: remove $(HOST_DIR)/usr part from HOST_LDFLAGS
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (4 preceding siblings ...)
2017-07-04 14:03 ` [Buildroot] [PATCH v3 05/14] Makefile: remove $(HOST_DIR)/usr from BR_PATH Arnout Vandecappelle
@ 2017-07-04 14:03 ` Arnout Vandecappelle
2017-07-04 15:04 ` Romain Naour
2017-07-04 14:03 ` [Buildroot] [PATCH v3 07/14] gdb: Remove /usr part from installation path of gdbserver Arnout Vandecappelle
` (8 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:03 UTC (permalink / raw)
To: buildroot
Now $(HOST_DIR)/lib and $(HOST_DIR)/usr/lib are the same directory, it
doesn't make sense to pass both to LDFLAGS.
Also use $(HOST_DIR)/lib instead of $(HOST_DIR)/usr/lib for the RPATH.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
package/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/Makefile.in b/package/Makefile.in
index 6b88ac4feb..25f1997fe6 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -220,7 +220,7 @@ HOST_CPPFLAGS = -I$(HOST_DIR)/usr/include
HOST_CFLAGS ?= -O2
HOST_CFLAGS += $(HOST_CPPFLAGS)
HOST_CXXFLAGS += $(HOST_CFLAGS)
-HOST_LDFLAGS += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib
+HOST_LDFLAGS += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
# host-intltool should be executed with the system perl, so we save
# the path to the system perl, before a host-perl built by Buildroot
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 06/14] package/Makefile.in: remove $(HOST_DIR)/usr part from HOST_LDFLAGS
2017-07-04 14:03 ` [Buildroot] [PATCH v3 06/14] package/Makefile.in: remove $(HOST_DIR)/usr part from HOST_LDFLAGS Arnout Vandecappelle
@ 2017-07-04 15:04 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:04 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:03, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Now $(HOST_DIR)/lib and $(HOST_DIR)/usr/lib are the same directory, it
> doesn't make sense to pass both to LDFLAGS.
>
> Also use $(HOST_DIR)/lib instead of $(HOST_DIR)/usr/lib for the RPATH.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> package/Makefile.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 6b88ac4feb..25f1997fe6 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -220,7 +220,7 @@ HOST_CPPFLAGS = -I$(HOST_DIR)/usr/include
> HOST_CFLAGS ?= -O2
> HOST_CFLAGS += $(HOST_CPPFLAGS)
> HOST_CXXFLAGS += $(HOST_CFLAGS)
> -HOST_LDFLAGS += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib
> +HOST_LDFLAGS += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
>
> # host-intltool should be executed with the system perl, so we save
> # the path to the system perl, before a host-perl built by Buildroot
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 07/14] gdb: Remove /usr part from installation path of gdbserver
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (5 preceding siblings ...)
2017-07-04 14:03 ` [Buildroot] [PATCH v3 06/14] package/Makefile.in: remove $(HOST_DIR)/usr part from HOST_LDFLAGS Arnout Vandecappelle
@ 2017-07-04 14:03 ` Arnout Vandecappelle
2017-07-04 15:08 ` Romain Naour
2017-07-04 14:03 ` [Buildroot] [PATCH v3 08/14] gcc-final: things are no longer installed in $(HOST_DIR)/usr Arnout Vandecappelle
` (7 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:03 UTC (permalink / raw)
To: buildroot
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
package/gdb/gdb.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 7036b4cb0f..9a97cb77a7 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -181,7 +181,7 @@ GDB_POST_INSTALL_TARGET_HOOKS += GDB_REMOVE_UNNEEDED_FILES
# does.
define GDB_SDK_INSTALL_GDBSERVER
$(INSTALL) -D -m 0755 $(TARGET_DIR)/usr/bin/gdbserver \
- $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/debug-root/usr/bin/gdbserver
+ $(HOST_DIR)/$(GNU_TARGET_NAME)/debug-root/usr/bin/gdbserver
endef
ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 07/14] gdb: Remove /usr part from installation path of gdbserver
2017-07-04 14:03 ` [Buildroot] [PATCH v3 07/14] gdb: Remove /usr part from installation path of gdbserver Arnout Vandecappelle
@ 2017-07-04 15:08 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:08 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:03, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
There are two other $(HOST_DIR)/usr in gdb.mk but I guess it will be done in a
follow up patch.
Best regards,
Romain
> ---
> package/gdb/gdb.mk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
> index 7036b4cb0f..9a97cb77a7 100644
> --- a/package/gdb/gdb.mk
> +++ b/package/gdb/gdb.mk
> @@ -181,7 +181,7 @@ GDB_POST_INSTALL_TARGET_HOOKS += GDB_REMOVE_UNNEEDED_FILES
> # does.
> define GDB_SDK_INSTALL_GDBSERVER
> $(INSTALL) -D -m 0755 $(TARGET_DIR)/usr/bin/gdbserver \
> - $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/debug-root/usr/bin/gdbserver
> + $(HOST_DIR)/$(GNU_TARGET_NAME)/debug-root/usr/bin/gdbserver
> endef
>
> ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 08/14] gcc-final: things are no longer installed in $(HOST_DIR)/usr
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (6 preceding siblings ...)
2017-07-04 14:03 ` [Buildroot] [PATCH v3 07/14] gdb: Remove /usr part from installation path of gdbserver Arnout Vandecappelle
@ 2017-07-04 14:03 ` Arnout Vandecappelle
2017-07-04 15:12 ` Romain Naour
2017-07-04 14:03 ` [Buildroot] [PATCH v3 09/14] pkg-autotools: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix Arnout Vandecappelle
` (6 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:03 UTC (permalink / raw)
To: buildroot
Since things are no longer installed in $(HOST_DIR)/usr, the callers
should also not refer to it.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
package/gcc/gcc-final/gcc-final.mk | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
index e8d2e18fe5..12f08c81a8 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -59,18 +59,18 @@ GCC_FINAL_CROSS_LANGUAGES = $(subst $(space),$(comma),$(GCC_FINAL_CROSS_LANGUAGE
HOST_GCC_FINAL_CONF_OPTS = \
$(HOST_GCC_COMMON_CONF_OPTS) \
--enable-languages=$(GCC_FINAL_CROSS_LANGUAGES) \
- --with-build-time-tools=$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/bin
+ --with-build-time-tools=$(HOST_DIR)/$(GNU_TARGET_NAME)/bin
-HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*
+HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib*
# The kernel wants to use the -m4-nofpu option to make sure that it
# doesn't use floating point operations.
ifeq ($(BR2_sh4)$(BR2_sh4eb),y)
HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4,m4-nofpu"
-HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4*
+HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib/!m4*
endif
ifeq ($(BR2_sh4a)$(BR2_sh4aeb),y)
HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4a,m4a-nofpu"
-HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4*
+HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib/!m4*
endif
ifeq ($(BR2_bfin),y)
@@ -103,9 +103,9 @@ HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS)
# Make sure we have 'cc'
define HOST_GCC_FINAL_CREATE_CC_SYMLINKS
- if [ ! -e $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc ]; then \
- ln -f $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-gcc \
- $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc; \
+ if [ ! -e $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-cc ]; then \
+ ln -f $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-gcc \
+ $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-cc; \
fi
endef
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 08/14] gcc-final: things are no longer installed in $(HOST_DIR)/usr
2017-07-04 14:03 ` [Buildroot] [PATCH v3 08/14] gcc-final: things are no longer installed in $(HOST_DIR)/usr Arnout Vandecappelle
@ 2017-07-04 15:12 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:12 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:03, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Since things are no longer installed in $(HOST_DIR)/usr, the callers
> should also not refer to it.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Same as for gdb, there are also other reference to $(HOST_DIR)/usr in gcc/gcc.mk
and gcc/gcc-final/gcc-final.mk but as you explained privately, this patch is
doing only
s:$(HOST_DIR)/usr/$(GNU_TARGET_NAME):$(HOST_DIR)/$(GNU_TARGET_NAME):
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> package/gcc/gcc-final/gcc-final.mk | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
> index e8d2e18fe5..12f08c81a8 100644
> --- a/package/gcc/gcc-final/gcc-final.mk
> +++ b/package/gcc/gcc-final/gcc-final.mk
> @@ -59,18 +59,18 @@ GCC_FINAL_CROSS_LANGUAGES = $(subst $(space),$(comma),$(GCC_FINAL_CROSS_LANGUAGE
> HOST_GCC_FINAL_CONF_OPTS = \
> $(HOST_GCC_COMMON_CONF_OPTS) \
> --enable-languages=$(GCC_FINAL_CROSS_LANGUAGES) \
> - --with-build-time-tools=$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/bin
> + --with-build-time-tools=$(HOST_DIR)/$(GNU_TARGET_NAME)/bin
>
> -HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*
> +HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib*
> # The kernel wants to use the -m4-nofpu option to make sure that it
> # doesn't use floating point operations.
> ifeq ($(BR2_sh4)$(BR2_sh4eb),y)
> HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4,m4-nofpu"
> -HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4*
> +HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib/!m4*
> endif
> ifeq ($(BR2_sh4a)$(BR2_sh4aeb),y)
> HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4a,m4a-nofpu"
> -HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4*
> +HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib/!m4*
> endif
>
> ifeq ($(BR2_bfin),y)
> @@ -103,9 +103,9 @@ HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS)
>
> # Make sure we have 'cc'
> define HOST_GCC_FINAL_CREATE_CC_SYMLINKS
> - if [ ! -e $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc ]; then \
> - ln -f $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-gcc \
> - $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc; \
> + if [ ! -e $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-cc ]; then \
> + ln -f $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-gcc \
> + $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-cc; \
> fi
> endef
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 09/14] pkg-autotools: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (7 preceding siblings ...)
2017-07-04 14:03 ` [Buildroot] [PATCH v3 08/14] gcc-final: things are no longer installed in $(HOST_DIR)/usr Arnout Vandecappelle
@ 2017-07-04 14:03 ` Arnout Vandecappelle
2017-07-04 15:12 ` Romain Naour
2017-07-04 14:04 ` [Buildroot] [PATCH v3 10/14] pkg-cmake: " Arnout Vandecappelle
` (5 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:03 UTC (permalink / raw)
To: buildroot
Remove the redundant usr/ component of the HOST_DIR paths. Since a
previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR),
everything keeps on working.
Build-tested with a bunch of autotools packages.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
package/pkg-autotools.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index e215382d06..03e25b3694 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -220,7 +220,7 @@ define $(2)_CONFIGURE_CMDS
$$($$(PKG)_CONF_ENV) \
CONFIG_SITE=/dev/null \
./configure \
- --prefix="$$(HOST_DIR)/usr" \
+ --prefix="$$(HOST_DIR)" \
--sysconfdir="$$(HOST_DIR)/etc" \
--localstatedir="$$(HOST_DIR)/var" \
--enable-shared --disable-static \
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 09/14] pkg-autotools: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
2017-07-04 14:03 ` [Buildroot] [PATCH v3 09/14] pkg-autotools: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix Arnout Vandecappelle
@ 2017-07-04 15:12 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:12 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:03, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Remove the redundant usr/ component of the HOST_DIR paths. Since a
> previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR),
> everything keeps on working.
>
> Build-tested with a bunch of autotools packages.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> package/pkg-autotools.mk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
> index e215382d06..03e25b3694 100644
> --- a/package/pkg-autotools.mk
> +++ b/package/pkg-autotools.mk
> @@ -220,7 +220,7 @@ define $(2)_CONFIGURE_CMDS
> $$($$(PKG)_CONF_ENV) \
> CONFIG_SITE=/dev/null \
> ./configure \
> - --prefix="$$(HOST_DIR)/usr" \
> + --prefix="$$(HOST_DIR)" \
> --sysconfdir="$$(HOST_DIR)/etc" \
> --localstatedir="$$(HOST_DIR)/var" \
> --enable-shared --disable-static \
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 10/14] pkg-cmake: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (8 preceding siblings ...)
2017-07-04 14:03 ` [Buildroot] [PATCH v3 09/14] pkg-autotools: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix Arnout Vandecappelle
@ 2017-07-04 14:04 ` Arnout Vandecappelle
2017-07-04 15:13 ` Romain Naour
2017-07-04 14:04 ` [Buildroot] [PATCH v3 11/14] pkg-cmake: move configuration files out of $(HOST_DIR)/usr Arnout Vandecappelle
` (4 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:04 UTC (permalink / raw)
To: buildroot
Remove the redundant usr/ component of the HOST_DIR paths. Since a
previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR),
everything keeps on working.
Build-tested with a bunch of cmake packages.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
package/pkg-cmake.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 0897430f70..0606d26ad7 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -115,7 +115,7 @@ define $(2)_CONFIGURE_CMDS
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="BOTH" \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="BOTH" \
- -DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)/usr" \
+ -DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)" \
-DCMAKE_C_FLAGS="$$(HOST_CFLAGS)" \
-DCMAKE_CXX_FLAGS="$$(HOST_CXXFLAGS)" \
-DCMAKE_EXE_LINKER_FLAGS="$$(HOST_LDFLAGS)" \
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 10/14] pkg-cmake: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
2017-07-04 14:04 ` [Buildroot] [PATCH v3 10/14] pkg-cmake: " Arnout Vandecappelle
@ 2017-07-04 15:13 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:13 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:04, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Remove the redundant usr/ component of the HOST_DIR paths. Since a
> previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR),
> everything keeps on working.
>
> Build-tested with a bunch of cmake packages.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> package/pkg-cmake.mk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 0897430f70..0606d26ad7 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -115,7 +115,7 @@ define $(2)_CONFIGURE_CMDS
> -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \
> -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="BOTH" \
> -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="BOTH" \
> - -DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)/usr" \
> + -DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)" \
> -DCMAKE_C_FLAGS="$$(HOST_CFLAGS)" \
> -DCMAKE_CXX_FLAGS="$$(HOST_CXXFLAGS)" \
> -DCMAKE_EXE_LINKER_FLAGS="$$(HOST_LDFLAGS)" \
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 11/14] pkg-cmake: move configuration files out of $(HOST_DIR)/usr
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (9 preceding siblings ...)
2017-07-04 14:04 ` [Buildroot] [PATCH v3 10/14] pkg-cmake: " Arnout Vandecappelle
@ 2017-07-04 14:04 ` Arnout Vandecappelle
2017-07-04 15:14 ` Romain Naour
2017-07-04 14:04 ` [Buildroot] [PATCH v3 12/14] pkg-cmake: programs are now installed in $(HOST_DIR)/bin Arnout Vandecappelle
` (3 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:04 UTC (permalink / raw)
To: buildroot
Move toolchainfile.cmake and Buildroot.cmake from
$(HOST_DIR)/usr/share/buildroot to $(HOST_DIR)/share/buildroot.
Build-tested with a bunch of cmake packages.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
package/pkg-cmake.mk | 8 ++++----
support/misc/toolchainfile.cmake.in | 4 ++--
toolchain/toolchain/toolchain.mk | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 0606d26ad7..1bb3652a13 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -86,7 +86,7 @@ define $(2)_CONFIGURE_CMDS
rm -f CMakeCache.txt && \
PATH=$$(BR_PATH) \
$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
- -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
+ -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/share/buildroot/toolchainfile.cmake" \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_COLOR_MAKEFILE=OFF \
-DBUILD_DOC=OFF \
@@ -234,10 +234,10 @@ CMAKE_SYSTEM_PROCESSOR = $(BR2_ARCH)
endif
# In order to allow the toolchain to be relocated, we calculate the HOST_DIR
-# based on the toolchainfile.cmake file's location: $(HOST_DIR)/usr/share/buildroot
+# based on the toolchainfile.cmake file's location: $(HOST_DIR)/share/buildroot
# In all the other variables, HOST_DIR will be replaced by RELOCATED_HOST_DIR,
# so we have to strip "$(HOST_DIR)/" from the paths that contain it.
-$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
+$(HOST_DIR)/share/buildroot/toolchainfile.cmake:
@mkdir -p $(@D)
sed \
-e 's#@@STAGING_SUBDIR@@#$(call qstrip,$(STAGING_SUBDIR))#' \
@@ -254,5 +254,5 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
$(TOPDIR)/support/misc/toolchainfile.cmake.in \
> $@
-$(HOST_DIR)/usr/share/buildroot/Platform/Buildroot.cmake:
+$(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake:
$(Q)$(INSTALL) -D -m 0644 support/misc/Buildroot.cmake $(@)
diff --git a/support/misc/toolchainfile.cmake.in b/support/misc/toolchainfile.cmake.in
index c38800e598..c8c710bddd 100644
--- a/support/misc/toolchainfile.cmake.in
+++ b/support/misc/toolchainfile.cmake.in
@@ -4,11 +4,11 @@
#
# In order to allow the toolchain to be relocated, we calculate the
-# HOST_DIR based on this file's location: $(HOST_DIR)/usr/share/buildroot
+# HOST_DIR based on this file's location: $(HOST_DIR)/share/buildroot
# and store it in RELOCATED_HOST_DIR.
# All the other variables that need to refer to HOST_DIR will use the
# RELOCATED_HOST_DIR variable.
-string(REPLACE "/usr/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST_DIR})
+string(REPLACE "/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST_DIR})
# Point cmake to the location where we have our custom modules,
# so that it can find our custom platform description.
diff --git a/toolchain/toolchain/toolchain.mk b/toolchain/toolchain/toolchain.mk
index e15ceeb426..b55b0c712c 100644
--- a/toolchain/toolchain/toolchain.mk
+++ b/toolchain/toolchain/toolchain.mk
@@ -39,5 +39,5 @@ endif
$(eval $(virtual-package))
-toolchain: $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake
-toolchain: $(HOST_DIR)/usr/share/buildroot/Platform/Buildroot.cmake
+toolchain: $(HOST_DIR)/share/buildroot/toolchainfile.cmake
+toolchain: $(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 11/14] pkg-cmake: move configuration files out of $(HOST_DIR)/usr
2017-07-04 14:04 ` [Buildroot] [PATCH v3 11/14] pkg-cmake: move configuration files out of $(HOST_DIR)/usr Arnout Vandecappelle
@ 2017-07-04 15:14 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:14 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:04, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Move toolchainfile.cmake and Buildroot.cmake from
> $(HOST_DIR)/usr/share/buildroot to $(HOST_DIR)/share/buildroot.
>
> Build-tested with a bunch of cmake packages.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> package/pkg-cmake.mk | 8 ++++----
> support/misc/toolchainfile.cmake.in | 4 ++--
> toolchain/toolchain/toolchain.mk | 4 ++--
> 3 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 0606d26ad7..1bb3652a13 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -86,7 +86,7 @@ define $(2)_CONFIGURE_CMDS
> rm -f CMakeCache.txt && \
> PATH=$$(BR_PATH) \
> $$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
> - -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
> + -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/share/buildroot/toolchainfile.cmake" \
> -DCMAKE_INSTALL_PREFIX="/usr" \
> -DCMAKE_COLOR_MAKEFILE=OFF \
> -DBUILD_DOC=OFF \
> @@ -234,10 +234,10 @@ CMAKE_SYSTEM_PROCESSOR = $(BR2_ARCH)
> endif
>
> # In order to allow the toolchain to be relocated, we calculate the HOST_DIR
> -# based on the toolchainfile.cmake file's location: $(HOST_DIR)/usr/share/buildroot
> +# based on the toolchainfile.cmake file's location: $(HOST_DIR)/share/buildroot
> # In all the other variables, HOST_DIR will be replaced by RELOCATED_HOST_DIR,
> # so we have to strip "$(HOST_DIR)/" from the paths that contain it.
> -$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
> +$(HOST_DIR)/share/buildroot/toolchainfile.cmake:
> @mkdir -p $(@D)
> sed \
> -e 's#@@STAGING_SUBDIR@@#$(call qstrip,$(STAGING_SUBDIR))#' \
> @@ -254,5 +254,5 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
> $(TOPDIR)/support/misc/toolchainfile.cmake.in \
> > $@
>
> -$(HOST_DIR)/usr/share/buildroot/Platform/Buildroot.cmake:
> +$(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake:
> $(Q)$(INSTALL) -D -m 0644 support/misc/Buildroot.cmake $(@)
> diff --git a/support/misc/toolchainfile.cmake.in b/support/misc/toolchainfile.cmake.in
> index c38800e598..c8c710bddd 100644
> --- a/support/misc/toolchainfile.cmake.in
> +++ b/support/misc/toolchainfile.cmake.in
> @@ -4,11 +4,11 @@
> #
>
> # In order to allow the toolchain to be relocated, we calculate the
> -# HOST_DIR based on this file's location: $(HOST_DIR)/usr/share/buildroot
> +# HOST_DIR based on this file's location: $(HOST_DIR)/share/buildroot
> # and store it in RELOCATED_HOST_DIR.
> # All the other variables that need to refer to HOST_DIR will use the
> # RELOCATED_HOST_DIR variable.
> -string(REPLACE "/usr/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST_DIR})
> +string(REPLACE "/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST_DIR})
>
> # Point cmake to the location where we have our custom modules,
> # so that it can find our custom platform description.
> diff --git a/toolchain/toolchain/toolchain.mk b/toolchain/toolchain/toolchain.mk
> index e15ceeb426..b55b0c712c 100644
> --- a/toolchain/toolchain/toolchain.mk
> +++ b/toolchain/toolchain/toolchain.mk
> @@ -39,5 +39,5 @@ endif
>
> $(eval $(virtual-package))
>
> -toolchain: $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake
> -toolchain: $(HOST_DIR)/usr/share/buildroot/Platform/Buildroot.cmake
> +toolchain: $(HOST_DIR)/share/buildroot/toolchainfile.cmake
> +toolchain: $(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 12/14] pkg-cmake: programs are now installed in $(HOST_DIR)/bin
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (10 preceding siblings ...)
2017-07-04 14:04 ` [Buildroot] [PATCH v3 11/14] pkg-cmake: move configuration files out of $(HOST_DIR)/usr Arnout Vandecappelle
@ 2017-07-04 14:04 ` Arnout Vandecappelle
2017-07-04 15:15 ` Romain Naour
2017-07-04 14:04 ` [Buildroot] [PATCH v3 13/14] pkg-python: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix Arnout Vandecappelle
` (2 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:04 UTC (permalink / raw)
To: buildroot
Remove the redundant usr/ component of the HOST_DIR paths. Since a
previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR),
everything keeps on working.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
support/misc/toolchainfile.cmake.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/support/misc/toolchainfile.cmake.in b/support/misc/toolchainfile.cmake.in
index c8c710bddd..1f5d2371ed 100644
--- a/support/misc/toolchainfile.cmake.in
+++ b/support/misc/toolchainfile.cmake.in
@@ -48,7 +48,7 @@ set(CMAKE_EXE_LINKER_FLAGS "@@TARGET_LDFLAGS@@" CACHE STRING "Buildroot LDFLAGS
set(CMAKE_INSTALL_SO_NO_EXE 0)
-set(CMAKE_PROGRAM_PATH "${RELOCATED_HOST_DIR}/usr/bin")
+set(CMAKE_PROGRAM_PATH "${RELOCATED_HOST_DIR}/bin")
set(CMAKE_SYSROOT "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
set(CMAKE_FIND_ROOT_PATH "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 12/14] pkg-cmake: programs are now installed in $(HOST_DIR)/bin
2017-07-04 14:04 ` [Buildroot] [PATCH v3 12/14] pkg-cmake: programs are now installed in $(HOST_DIR)/bin Arnout Vandecappelle
@ 2017-07-04 15:15 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:15 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:04, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Remove the redundant usr/ component of the HOST_DIR paths. Since a
> previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR),
> everything keeps on working.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> support/misc/toolchainfile.cmake.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/support/misc/toolchainfile.cmake.in b/support/misc/toolchainfile.cmake.in
> index c8c710bddd..1f5d2371ed 100644
> --- a/support/misc/toolchainfile.cmake.in
> +++ b/support/misc/toolchainfile.cmake.in
> @@ -48,7 +48,7 @@ set(CMAKE_EXE_LINKER_FLAGS "@@TARGET_LDFLAGS@@" CACHE STRING "Buildroot LDFLAGS
>
> set(CMAKE_INSTALL_SO_NO_EXE 0)
>
> -set(CMAKE_PROGRAM_PATH "${RELOCATED_HOST_DIR}/usr/bin")
> +set(CMAKE_PROGRAM_PATH "${RELOCATED_HOST_DIR}/bin")
> set(CMAKE_SYSROOT "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
> set(CMAKE_FIND_ROOT_PATH "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
> set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 13/14] pkg-python: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (11 preceding siblings ...)
2017-07-04 14:04 ` [Buildroot] [PATCH v3 12/14] pkg-cmake: programs are now installed in $(HOST_DIR)/bin Arnout Vandecappelle
@ 2017-07-04 14:04 ` Arnout Vandecappelle
2017-07-04 15:16 ` Romain Naour
2017-07-04 14:04 ` [Buildroot] [PATCH v3 14/14] pkg-rebar: " Arnout Vandecappelle
2017-07-05 9:57 ` [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Thomas Petazzoni
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:04 UTC (permalink / raw)
To: buildroot
Remove the redundant usr/ component of the HOST_DIR paths. Since a
previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR),
everything keeps on working.
Build-tested with a bunch of python packages.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
package/pkg-python.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index 2418f5dfa4..6e411ab5c5 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -53,7 +53,7 @@ HOST_PKG_PYTHON_DISTUTILS_ENV = \
PYTHONNOUSERSITE=1
HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \
- --prefix=$(HOST_DIR)/usr
+ --prefix=$(HOST_DIR)
# Target setuptools-based packages
PKG_PYTHON_SETUPTOOLS_ENV = \
@@ -83,7 +83,7 @@ HOST_PKG_PYTHON_SETUPTOOLS_ENV = \
PYTHONNOUSERSITE=1
HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
- --prefix=$(HOST_DIR)/usr
+ --prefix=$(HOST_DIR)
################################################################################
# inner-python-package -- defines how the configuration, compilation
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 13/14] pkg-python: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
2017-07-04 14:04 ` [Buildroot] [PATCH v3 13/14] pkg-python: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix Arnout Vandecappelle
@ 2017-07-04 15:16 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:16 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:04, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Remove the redundant usr/ component of the HOST_DIR paths. Since a
> previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR),
> everything keeps on working.
>
> Build-tested with a bunch of python packages.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> package/pkg-python.mk | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> index 2418f5dfa4..6e411ab5c5 100644
> --- a/package/pkg-python.mk
> +++ b/package/pkg-python.mk
> @@ -53,7 +53,7 @@ HOST_PKG_PYTHON_DISTUTILS_ENV = \
> PYTHONNOUSERSITE=1
>
> HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \
> - --prefix=$(HOST_DIR)/usr
> + --prefix=$(HOST_DIR)
>
> # Target setuptools-based packages
> PKG_PYTHON_SETUPTOOLS_ENV = \
> @@ -83,7 +83,7 @@ HOST_PKG_PYTHON_SETUPTOOLS_ENV = \
> PYTHONNOUSERSITE=1
>
> HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
> - --prefix=$(HOST_DIR)/usr
> + --prefix=$(HOST_DIR)
>
> ################################################################################
> # inner-python-package -- defines how the configuration, compilation
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 14/14] pkg-rebar: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (12 preceding siblings ...)
2017-07-04 14:04 ` [Buildroot] [PATCH v3 13/14] pkg-python: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix Arnout Vandecappelle
@ 2017-07-04 14:04 ` Arnout Vandecappelle
2017-07-04 15:19 ` Romain Naour
2017-07-05 9:57 ` [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Thomas Petazzoni
14 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 14:04 UTC (permalink / raw)
To: buildroot
Remove the redundant usr/ component of the HOST_DIR paths. Since a
previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR),
everything keeps on working.
$(PKG)_ERLANG_LIBDIR is problematic because it is used both for host
and staging/target. Therefore, the usr/ part is removed from it, and
added the the callers instead.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Frank Hunleth <fhunleth@troodon-software.com>
---
v2: ERLANG_LIBDIR no longer starts with a /
---
package/pkg-rebar.mk | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/package/pkg-rebar.mk b/package/pkg-rebar.mk
index cc6b775ae5..e2b4a58681 100644
--- a/package/pkg-rebar.mk
+++ b/package/pkg-rebar.mk
@@ -25,14 +25,14 @@
# infrastructure tells rebar to NOT download dependencies during
# the build stage.
#
-REBAR_HOST_DEPS_DIR = $(HOST_DIR)/usr/share/rebar/deps
+REBAR_HOST_DEPS_DIR = $(HOST_DIR)/share/rebar/deps
REBAR_TARGET_DEPS_DIR = $(STAGING_DIR)/usr/share/rebar/deps
# Tell rebar where to find the dependencies
#
REBAR_HOST_DEPS_ENV = \
ERL_COMPILER_OPTIONS='{i, "$(REBAR_HOST_DEPS_DIR)"}' \
- ERL_EI_LIBDIR=$(HOST_DIR)/usr/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
+ ERL_EI_LIBDIR=$(HOST_DIR)/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
REBAR_TARGET_DEPS_ENV = \
ERL_COMPILER_OPTIONS='{i, "$(REBAR_TARGET_DEPS_DIR)"}' \
ERL_EI_LIBDIR=$(STAGING_DIR)/usr/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
@@ -119,10 +119,10 @@ define inner-rebar-package
$(2)_ERLANG_APP = $(subst -,_,$(patsubst erlang-%,%,$(patsubst host-%,%,$(1))))
# Path where to store the package's libs, relative to either $(HOST_DIR)
-# for host packages, or $(STAGING_DIR) for target packages.
+# for host packages, or $(STAGING_DIR)/usr for target packages.
#
$(2)_ERLANG_LIBDIR = \
- usr/lib/erlang/lib/$$($$(PKG)_ERLANG_APP)-$$($$(PKG)_VERSION)
+ lib/erlang/lib/$$($$(PKG)_ERLANG_APP)-$$($$(PKG)_VERSION)
# If a host package, inherit <pkg>_USE_BUNDLED_REBAR from the target
# package, if not explicitly defined. Otherwise, default to NO.
@@ -173,8 +173,8 @@ endif
# package-related variables
ifndef $(2)_INSTALL_STAGING_CMDS
define $(2)_INSTALL_STAGING_CMDS
- $$(call install-erlang-directories,$$(STAGING_DIR),include)
- $$(call install-rebar-deps,$$(STAGING_DIR),TARGET)
+ $$(call install-erlang-directories,$$(STAGING_DIR)/usr,include)
+ $$(call install-rebar-deps,$$(STAGING_DIR)/usr,TARGET)
endef
endif
@@ -182,7 +182,7 @@ endif
# package-related variables
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
- $$(call install-erlang-directories,$$(TARGET_DIR))
+ $$(call install-erlang-directories,$$(TARGET_DIR)/usr)
endef
endif
--
2.13.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 14/14] pkg-rebar: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
2017-07-04 14:04 ` [Buildroot] [PATCH v3 14/14] pkg-rebar: " Arnout Vandecappelle
@ 2017-07-04 15:19 ` Romain Naour
0 siblings, 0 replies; 30+ messages in thread
From: Romain Naour @ 2017-07-04 15:19 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Le 04/07/2017 ? 16:04, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Remove the redundant usr/ component of the HOST_DIR paths. Since a
> previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR),
> everything keeps on working.
>
> $(PKG)_ERLANG_LIBDIR is problematic because it is used both for host
> and staging/target. Therefore, the usr/ part is removed from it, and
> added the the callers instead.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Cc: Frank Hunleth <fhunleth@troodon-software.com>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
> ---
> v2: ERLANG_LIBDIR no longer starts with a /
> ---
> package/pkg-rebar.mk | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/package/pkg-rebar.mk b/package/pkg-rebar.mk
> index cc6b775ae5..e2b4a58681 100644
> --- a/package/pkg-rebar.mk
> +++ b/package/pkg-rebar.mk
> @@ -25,14 +25,14 @@
> # infrastructure tells rebar to NOT download dependencies during
> # the build stage.
> #
> -REBAR_HOST_DEPS_DIR = $(HOST_DIR)/usr/share/rebar/deps
> +REBAR_HOST_DEPS_DIR = $(HOST_DIR)/share/rebar/deps
> REBAR_TARGET_DEPS_DIR = $(STAGING_DIR)/usr/share/rebar/deps
>
> # Tell rebar where to find the dependencies
> #
> REBAR_HOST_DEPS_ENV = \
> ERL_COMPILER_OPTIONS='{i, "$(REBAR_HOST_DEPS_DIR)"}' \
> - ERL_EI_LIBDIR=$(HOST_DIR)/usr/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
> + ERL_EI_LIBDIR=$(HOST_DIR)/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
> REBAR_TARGET_DEPS_ENV = \
> ERL_COMPILER_OPTIONS='{i, "$(REBAR_TARGET_DEPS_DIR)"}' \
> ERL_EI_LIBDIR=$(STAGING_DIR)/usr/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
> @@ -119,10 +119,10 @@ define inner-rebar-package
> $(2)_ERLANG_APP = $(subst -,_,$(patsubst erlang-%,%,$(patsubst host-%,%,$(1))))
>
> # Path where to store the package's libs, relative to either $(HOST_DIR)
> -# for host packages, or $(STAGING_DIR) for target packages.
> +# for host packages, or $(STAGING_DIR)/usr for target packages.
> #
> $(2)_ERLANG_LIBDIR = \
> - usr/lib/erlang/lib/$$($$(PKG)_ERLANG_APP)-$$($$(PKG)_VERSION)
> + lib/erlang/lib/$$($$(PKG)_ERLANG_APP)-$$($$(PKG)_VERSION)
>
> # If a host package, inherit <pkg>_USE_BUNDLED_REBAR from the target
> # package, if not explicitly defined. Otherwise, default to NO.
> @@ -173,8 +173,8 @@ endif
> # package-related variables
> ifndef $(2)_INSTALL_STAGING_CMDS
> define $(2)_INSTALL_STAGING_CMDS
> - $$(call install-erlang-directories,$$(STAGING_DIR),include)
> - $$(call install-rebar-deps,$$(STAGING_DIR),TARGET)
> + $$(call install-erlang-directories,$$(STAGING_DIR)/usr,include)
> + $$(call install-rebar-deps,$$(STAGING_DIR)/usr,TARGET)
> endef
> endif
>
> @@ -182,7 +182,7 @@ endif
> # package-related variables
> ifndef $(2)_INSTALL_TARGET_CMDS
> define $(2)_INSTALL_TARGET_CMDS
> - $$(call install-erlang-directories,$$(TARGET_DIR))
> + $$(call install-erlang-directories,$$(TARGET_DIR)/usr)
> endef
> endif
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR
2017-07-04 14:03 [Buildroot] [PATCH v3 00/14] Remove /usr component from HOST_DIR Arnout Vandecappelle
` (13 preceding siblings ...)
2017-07-04 14:04 ` [Buildroot] [PATCH v3 14/14] pkg-rebar: " Arnout Vandecappelle
@ 2017-07-05 9:57 ` Thomas Petazzoni
14 siblings, 0 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2017-07-05 9:57 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 4 Jul 2017 16:03:50 +0200, Arnout Vandecappelle
(Essensium/Mind) wrote:
> Arnout Vandecappelle (14):
> Move $(HOST_DIR)/usr/$(GNU_TARGET_NAME) one level up.
> Move $(HOST_DIR)/usr/lib to $(HOST_DIR)/lib
> Eliminate $(HOST_DIR)/usr
> check-host-rpath: no longer check $(HOST_DIR)/usr/{bin,sbin}
> Makefile: remove $(HOST_DIR)/usr from BR_PATH
> package/Makefile.in: remove $(HOST_DIR)/usr part from HOST_LDFLAGS
> gdb: Remove /usr part from installation path of gdbserver
> gcc-final: things are no longer installed in $(HOST_DIR)/usr
> pkg-autotools: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
> pkg-cmake: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
> pkg-cmake: move configuration files out of $(HOST_DIR)/usr
> pkg-cmake: programs are now installed in $(HOST_DIR)/bin
> pkg-python: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
> pkg-rebar: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
Series applied. Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 30+ messages in thread