Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sonic Zhang <sonic.adi@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 6/7] arch: Introduce blackfin-specific Makefile
Date: Fri, 29 Mar 2013 17:50:42 +0800	[thread overview]
Message-ID: <1364550643-11793-6-git-send-email-sonic.adi@gmail.com> (raw)
In-Reply-To: <1364550643-11793-1-git-send-email-sonic.adi@gmail.com>

From: Sonic Zhang <sonic.zhang@analog.com>

v2-changes:
- Remove useless Macro __uClinux__

v1-changes:
- Create arch makefile.
- Create blackfin makefile.
- Add FDPIC and FLAT library options and makefile targets to install
libraries for different binary formats into the same rootfs image.
- update the TARGET_EXCEPTIONS variable in support/scripts/graph-depends for
new custom targets

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 Makefile                      |    2 ++
 arch/Config.in.bfin           |   21 +++++++++++++++++++++
 arch/Makefile.in              |    5 +++++
 arch/Makefile.in.bfin         |   22 ++++++++++++++++++++++
 support/scripts/graph-depends |    2 ++
 5 files changed, 52 insertions(+), 0 deletions(-)
 create mode 100644 arch/Makefile.in
 create mode 100644 arch/Makefile.in.bfin

diff --git a/Makefile b/Makefile
index 7f0822f..c2f43a4 100644
--- a/Makefile
+++ b/Makefile
@@ -329,6 +329,8 @@ ifneq ($(PACKAGE_OVERRIDE_FILE),)
 -include $(PACKAGE_OVERRIDE_FILE)
 endif
 
+include arch/Makefile.in
+
 include package/*/*.mk
 
 include boot/common.mk
diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
index 021f5fe..038da4a 100644
--- a/arch/Config.in.bfin
+++ b/arch/Config.in.bfin
@@ -62,6 +62,27 @@ config BR2_bf561
 	bool "bf561"
 endchoice
 
+config BR2_BFIN_INSTALL_FDPIC_SHARED
+	depends on BR2_bfin && !BR2_BINFMT_FDPIC
+	bool "Install FDPIC shared libraries"
+	default y
+	help
+	  Blackfin Linux kernel supports running both FDPIC and FLAT applications
+	  concurrently if the binary format specific libraries installed properly.
+	  This option allow developer to install FDPIC libraries into a buildroot
+	  rootfs image built with binary format macro other than BR2_BINFMT_FDPIC.
+
+config BR2_BFIN_INSTALL_FLAT_SHARED
+	depends on BR2_bfin && !BR2_BINFMT_FLAT_SHARED
+	bool "Install FLAT shared libraries"
+	default y
+	help
+	  Blackfin Linux kernel supports running both FDPIC and FLAT applications
+	  concurrently if the binary format specific libraries installed properly.
+	  This option allow developer to install FLAT libraries into a buildroot
+	  rootfs image built with binary format macro other than
+	  BR2_BINFMT_FLAT_SHARED.
+
 config BR2_ARCH
 	default "bfin"
 
diff --git a/arch/Makefile.in b/arch/Makefile.in
new file mode 100644
index 0000000..d791118
--- /dev/null
+++ b/arch/Makefile.in
@@ -0,0 +1,5 @@
+# The architecture specific Makefile.in.$ARCH should be included only
+# when the arch macro is selected.
+ifeq ($(BR2_bfin),y)
+include arch/Makefile.in.bfin
+endif
diff --git a/arch/Makefile.in.bfin b/arch/Makefile.in.bfin
new file mode 100644
index 0000000..9089bc5
--- /dev/null
+++ b/arch/Makefile.in.bfin
@@ -0,0 +1,22 @@
+TARGETS_BFIN-$(BR2_BFIN_INSTALL_FDPIC_SHARED) += target-shared-libs-fdpic
+TARGETS_BFIN-$(BR2_BFIN_INSTALL_FLAT_SHARED) += target-shared-libs-flat
+TARGETS += $(TARGETS_BFIN-y)
+
+CROSS_COMPILE_SHARED_FDPIC ?= bfin-linux-uclibc-
+target-shared-libs-fdpic:
+	set -e; \
+	t=`$(CROSS_COMPILE_SHARED_FDPIC)gcc $(CPUFLAGS) -print-file-name=libc.a`; \
+	t=`dirname $$t`/../..; \
+	for i in $$t/lib/*so*; do \
+		i=`readlink -f "$$i"`; \
+		soname=`$(CROSS_COMPILE_SHARED_FDPIC)readelf -d "$$i" | sed -n '/(SONAME)/s:.*[[]\(.*\)[]].*:\1:p'`; \
+		$(INSTALL) -D $$i $(TARGET_DIR)/lib/$$soname; \
+	done
+
+CROSS_COMPILE_SHARED_FLAT ?= bfin-uclinux-
+target-shared-libs-flat:
+	set -e; \
+	t=`$(CROSS_COMPILE_SHARED_FLAT)gcc $(CPUFLAGS) -mid-shared-library -print-file-name=libc`; \
+	if [ -f $$t -a ! -h $$t ] ; then \
+		$(INSTALL) -D $$t $(TARGET_DIR)/lib/lib1.so; \
+	fi
diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends
index 1163d79..227d085 100755
--- a/support/scripts/graph-depends
+++ b/support/scripts/graph-depends
@@ -168,6 +168,8 @@ TARGET_EXCEPTIONS = [
     "erase-fakeroots",
     "target-generic-hostname",
     "target-root-passwd",
+    "target-shared-libs-fdpic",
+    "target-shared-libs-flat",
 ]
 
 # In full mode, start with the result of get_targets() to get the main
-- 
1.7.0.4

  parent reply	other threads:[~2013-03-29  9:50 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-29  9:50 [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice Sonic Zhang
2013-03-29  9:50 ` [Buildroot] [PATCH v2 2/7] arch: toolchain: Introduce target CPU revision Sonic Zhang
2013-04-07 20:42   ` Thomas Petazzoni
2013-04-08  6:30     ` Sonic Zhang
2013-03-29  9:50 ` [Buildroot] [PATCH v2 3/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
2013-04-07 20:45   ` Thomas Petazzoni
2013-04-08  6:03     ` Sonic Zhang
2013-04-07 20:47   ` Thomas Petazzoni
2013-04-08  6:04     ` Sonic Zhang
2013-03-29  9:50 ` [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types Sonic Zhang
2013-04-07 20:51   ` Thomas Petazzoni
2013-04-08  6:43     ` Sonic Zhang
2013-04-12  3:39     ` Sonic Zhang
2013-04-13 14:31       ` Thomas Petazzoni
2013-04-16 10:26         ` Sonic Zhang
2013-04-16 10:46           ` Thomas Petazzoni
2013-04-17  9:02             ` Sonic Zhang
2013-04-23  5:57               ` Sonic Zhang
2013-03-29  9:50 ` [Buildroot] [PATCH v2 5/7] package: Introduce package-specific BINFMT_FLAT options Sonic Zhang
2013-04-07 21:27   ` Thomas Petazzoni
2013-04-10  5:47     ` Arnout Vandecappelle
2013-04-10  8:10       ` Sonic Zhang
2013-04-10 10:36         ` Arnout Vandecappelle
2013-03-29  9:50 ` Sonic Zhang [this message]
2013-04-07 21:41   ` [Buildroot] [PATCH v2 6/7] arch: Introduce blackfin-specific Makefile Thomas Petazzoni
2013-04-08  7:19     ` Sonic Zhang
2013-04-08 21:23       ` Thomas Petazzoni
2013-03-29  9:50 ` [Buildroot] [PATCH v2 7/7] package: Introduce NOMMU symbol Sonic Zhang
2013-04-07 20:39 ` [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice Thomas Petazzoni
2013-04-08  3:28   ` Sonic Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364550643-11793-6-git-send-email-sonic.adi@gmail.com \
    --to=sonic.adi@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox