* [Buildroot] [PATCH 1/2] package/clang: delete unnecessary files from target
@ 2018-05-02 9:05 Valentin Korenblit
2018-05-02 9:05 ` [Buildroot] [PATCH 2/2] package/llvm: delete LLVMHello.so from /usr/lib Valentin Korenblit
2018-05-02 9:31 ` [Buildroot] [PATCH 1/2] package/clang: delete unnecessary files from target Thomas Petazzoni
0 siblings, 2 replies; 4+ messages in thread
From: Valentin Korenblit @ 2018-05-02 9:05 UTC (permalink / raw)
To: buildroot
Delete:
Binaries in: /usr/bin
/usr/libexec
Directories: /usr/lib/clang
/usr/share/clang
/usr/share/opt-viewer
/usr/share/scan-build
/usr/share/scan-view
Manual: /usr/share/man/man1/scan-build.1
Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
---
package/clang/clang.mk | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/package/clang/clang.mk b/package/clang/clang.mk
index 88bce9af0b..a599dc0ae6 100644
--- a/package/clang/clang.mk
+++ b/package/clang/clang.mk
@@ -56,9 +56,14 @@ CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(STAGING_DIR)/usr/bin/llvm-config \
# Clang can't be used as compiler on the target since there are no
# development files (headers) and other build tools. So remove clang
-# binaries from target.
+# binaries and some other unnecessary files from target.
define CLANG_DELETE_BINARIES_FROM_TARGET
- rm -f $(TARGET_DIR)/usr/bin/clang*
+ cd $(TARGET_DIR)/usr/bin && rm -f clang* c-index-test git-clang-format \
+ scan-build scan-view
+ cd $(TARGET_DIR)/usr/libexec && rm -f c++-analyzer ccc-analyzer
+ cd $(TARGET_DIR)/usr/share && rm -rf clang opt-viewer scan-build scan-view \
+ man/man1/scan-build.1
+ rm -rf $(TARGET_DIR)/usr/lib/clang
endef
CLANG_POST_INSTALL_TARGET_HOOKS += CLANG_DELETE_BINARIES_FROM_TARGET
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 2/2] package/llvm: delete LLVMHello.so from /usr/lib
2018-05-02 9:05 [Buildroot] [PATCH 1/2] package/clang: delete unnecessary files from target Valentin Korenblit
@ 2018-05-02 9:05 ` Valentin Korenblit
2018-05-02 9:37 ` Thomas Petazzoni
2018-05-02 9:31 ` [Buildroot] [PATCH 1/2] package/clang: delete unnecessary files from target Thomas Petazzoni
1 sibling, 1 reply; 4+ messages in thread
From: Valentin Korenblit @ 2018-05-02 9:05 UTC (permalink / raw)
To: buildroot
LLVMHello.so contains the Hello World example of an
LLVM pass. It is not needed on the target.
Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
---
package/llvm/llvm.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk
index a25495fbd7..978f176f28 100644
--- a/package/llvm/llvm.mk
+++ b/package/llvm/llvm.mk
@@ -267,9 +267,9 @@ endef
HOST_LLVM_POST_INSTALL_HOOKS = HOST_LLVM_COPY_LLVM_CONFIG_TO_STAGING_DIR
# By default llvm-tblgen is built and installed on the target but it is
-# not necessary.
+# not necessary. Also erase LLVMHello.so from /usr/lib
define LLVM_DELETE_LLVM_TBLGEN_TARGET
- rm -f $(TARGET_DIR)/usr/bin/llvm-tblgen
+ rm -f $(TARGET_DIR)/usr/bin/llvm-tblgen $(TARGET_DIR)/usr/lib/LLVMHello.so
endef
LLVM_POST_INSTALL_TARGET_HOOKS = LLVM_DELETE_LLVM_TBLGEN_TARGET
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 1/2] package/clang: delete unnecessary files from target
2018-05-02 9:05 [Buildroot] [PATCH 1/2] package/clang: delete unnecessary files from target Valentin Korenblit
2018-05-02 9:05 ` [Buildroot] [PATCH 2/2] package/llvm: delete LLVMHello.so from /usr/lib Valentin Korenblit
@ 2018-05-02 9:31 ` Thomas Petazzoni
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2018-05-02 9:31 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 2 May 2018 11:05:34 +0200, Valentin Korenblit wrote:
> diff --git a/package/clang/clang.mk b/package/clang/clang.mk
> index 88bce9af0b..a599dc0ae6 100644
> --- a/package/clang/clang.mk
> +++ b/package/clang/clang.mk
> @@ -56,9 +56,14 @@ CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(STAGING_DIR)/usr/bin/llvm-config \
>
> # Clang can't be used as compiler on the target since there are no
> # development files (headers) and other build tools. So remove clang
> -# binaries from target.
> +# binaries and some other unnecessary files from target.
> define CLANG_DELETE_BINARIES_FROM_TARGET
You're no longer removing just binaries :)
> - rm -f $(TARGET_DIR)/usr/bin/clang*
> + cd $(TARGET_DIR)/usr/bin && rm -f clang* c-index-test git-clang-format \
> + scan-build scan-view
> + cd $(TARGET_DIR)/usr/libexec && rm -f c++-analyzer ccc-analyzer
> + cd $(TARGET_DIR)/usr/share && rm -rf clang opt-viewer scan-build scan-view \
> + man/man1/scan-build.1
I think a slightly more Buildroot-ish way to do this is:
rm -f $(addprefix $(TARGET_DIR)/usr/bin/, \
clang* c-index-test git-clang-format scan-build scan-view)
and ditto for the others. Or perhaps, even more readable:
CLANG_FILES_TO_REMOVE = \
/usr/bin/clang* \
/usr/bin/c-index-test \
/usr/bin/git-clang-format \
/usr/bin/scan-build \
/usr/bin/scan-view \
...
and:
define CLANG_CLEANUP_TARGET
rm -f $(addprefix $(TARGET_DIR),$(CLANG_FILES_TO_REMOVE))
endef
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 2/2] package/llvm: delete LLVMHello.so from /usr/lib
2018-05-02 9:05 ` [Buildroot] [PATCH 2/2] package/llvm: delete LLVMHello.so from /usr/lib Valentin Korenblit
@ 2018-05-02 9:37 ` Thomas Petazzoni
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2018-05-02 9:37 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 2 May 2018 11:05:35 +0200, Valentin Korenblit wrote:
> LLVMHello.so contains the Hello World example of an
> LLVM pass. It is not needed on the target.
>
> Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
> ---
> package/llvm/llvm.mk | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-02 9:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-02 9:05 [Buildroot] [PATCH 1/2] package/clang: delete unnecessary files from target Valentin Korenblit
2018-05-02 9:05 ` [Buildroot] [PATCH 2/2] package/llvm: delete LLVMHello.so from /usr/lib Valentin Korenblit
2018-05-02 9:37 ` Thomas Petazzoni
2018-05-02 9:31 ` [Buildroot] [PATCH 1/2] package/clang: delete unnecessary files from target Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox