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 1/2 v2] buildroot: target: Add Blackfin architecture support.
Date: Tue, 21 Aug 2012 12:45:48 +0800	[thread overview]
Message-ID: <1345524349-709-1-git-send-email-sonic.adi@gmail.com> (raw)

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

1) Add blackfin cpu type option and install shared library
of different ABI option to target/Config.in.
2) Add makefile targets to install shared library of different ABI into
rootfs image.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 target/Config.in.arch |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 target/Makefile.in    |   24 ++++++++++++++++++++++++
 2 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/target/Config.in.arch b/target/Config.in.arch
index 342066e..54c7fa0 100644
--- a/target/Config.in.arch
+++ b/target/Config.in.arch
@@ -131,6 +131,15 @@ config BR2_xtensa
 	  http://www.tensilica.com/
 endchoice
 
+config BR2_ABI_FLAT
+	bool
+	default n
+
+config BR2_ABI_ELF
+	bool
+	default y
+	depends on !BR2_ABI_FLAT
+
 config BR2_microblaze
 	bool
 	default y if BR2_microblazeel || BR2_microblazebe
@@ -230,13 +239,45 @@ choice
 	default BR2_BFIN_FDPIC
 config BR2_BFIN_FDPIC
 	bool "FDPIC"
+	select BR2_ABI_ELF
 config BR2_BFIN_FLAT
 	bool "FLAT"
+	select BR2_ABI_FLAT
+	select BR2_PREFER_STATIC_LIB
+config BR2_BFIN_FLAT_SEP_DATA
+	bool "FLAT (Separate data)"
+	select BR2_ABI_FLAT
+	select BR2_PREFER_STATIC_LIB
+config BR2_BFIN_SHARED_FLAT
+	bool "Shared FLAT"
+	select BR2_ABI_FLAT
 	select BR2_PREFER_STATIC_LIB
 endchoice
 
 choice
 	prompt "Target Architecture Variant"
+	depends on BR2_bfin
+	default BR2_bf609
+	help
+	  Specific CPU variant to use
+config BR2_bf609
+	bool "bf609"
+config BR2_bf537
+	bool "bf537"
+endchoice
+
+config BR2_BFIN_INSTALL_ELF_SHARED
+	depends on BR2_bfin && !BR2_BFIN_FDPIC
+	bool "Install ELF shared libraries"
+	default y
+
+config BR2_BFIN_INSTALL_FLAT_SHARED
+	depends on BR2_bfin && !BR2_BFIN_SHARED_FLAT
+	bool "Install FLAT shared libraries"
+	default y
+
+choice
+	prompt "Target Architecture Variant"
 	depends on BR2_mips || BR2_mipsel
 	default BR2_mips_3 if BR2_mips
 	default BR2_mips_1 if BR2_mipsel
@@ -876,3 +917,9 @@ config BR2_GCC_TARGET_CPU
 	default sparchfleonv8	if BR2_sparc_sparchfleonv8
 	default sparcsfleon	if BR2_sparc_sparcsfleon
 	default sparcsfleonv8	if BR2_sparc_sparcsfleonv8
+	default bf609		if BR2_bf609
+	default bf537		if BR2_bf537
+
+config BR2_GCC_TARGET_CPU_REVISION
+	string "Target CPU revision"
+
diff --git a/target/Makefile.in b/target/Makefile.in
index 915d625..5c285ed 100644
--- a/target/Makefile.in
+++ b/target/Makefile.in
@@ -1,3 +1,27 @@
 # make sure to put everything that is board-specific before the tarroot targets
+TARGETS-y =
+TARGETS-$(BR2_BFIN_INSTALL_ELF_SHARED) += romfs.shared.libs.elf
+TARGETS-$(BR2_BFIN_INSTALL_FLAT_SHARED) += romfs.shared.libs.flat
+TARGETS += $(TARGETS-y)
+
+CROSS_COMPILE_SHARED_ELF ?= bfin-linux-uclibc-
+romfs.shared.libs.elf:
+	set -e; \
+	t=`$(CROSS_COMPILE_SHARED_ELF)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_ELF)readelf -d "$$i" | sed -n '/(SONAME)/s:.*[[]\(.*\)[]].*:\1:p'`; \
+		$(INSTALL) -D $$i $(TARGET_DIR)/lib/$$soname; \
+	done
+
+CROSS_COMPILE_SHARED_FLAT ?= bfin-uclinux-
+romfs.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
+
 include target/generic/Makefile.in
 
-- 
1.7.0.4

             reply	other threads:[~2012-08-21  4:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21  4:45 Sonic Zhang [this message]
2012-08-21  4:45 ` [Buildroot] [PATCH 2/2 v2] package: Makefile.in: Add target compilation flags for Blackfin 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=1345524349-709-1-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