Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice.
@ 2013-03-29  9:50 Sonic Zhang
  2013-03-29  9:50 ` [Buildroot] [PATCH v2 2/7] arch: toolchain: Introduce target CPU revision Sonic Zhang
                   ` (6 more replies)
  0 siblings, 7 replies; 30+ messages in thread
From: Sonic Zhang @ 2013-03-29  9:50 UTC (permalink / raw)
  To: buildroot

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

v2-changes:
none

v1-changes:
- is patch adds a Target CPU configuration option and uses it to select a -m
option for gcc.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 arch/Config.in.bfin |   97 +++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
index 0b137ae..ac96620 100644
--- a/arch/Config.in.bfin
+++ b/arch/Config.in.bfin
@@ -1,12 +1,65 @@
 choice
-	prompt "Target ABI"
+	prompt "Target CPU"
 	depends on BR2_bfin
-	default BR2_BFIN_FDPIC
-config BR2_BFIN_FDPIC
-	bool "FDPIC"
-config BR2_BFIN_FLAT
-	bool "FLAT"
-	select BR2_PREFER_STATIC_LIB
+	default BR2_bf609
+	help
+	  Specify target CPU
+config BR2_bf606
+	bool "bf606"
+config BR2_bf607
+	bool "bf607"
+config BR2_bf608
+	bool "bf608"
+config BR2_bf609
+	bool "bf609"
+config BR2_bf512
+	bool "bf512"
+config BR2_bf514
+	bool "bf514"
+config BR2_bf516
+	bool "bf516"
+config BR2_bf518
+	bool "bf518"
+config BR2_bf522
+	bool "bf522"
+config BR2_bf523
+	bool "bf523"
+config BR2_bf524
+	bool "bf524"
+config BR2_bf525
+	bool "bf525"
+config BR2_bf526
+	bool "bf526"
+config BR2_bf527
+	bool "bf527"
+config BR2_bf531
+	bool "bf531"
+config BR2_bf532
+	bool "bf532"
+config BR2_bf533
+	bool "bf533"
+config BR2_bf534
+	bool "bf534"
+config BR2_bf536
+	bool "bf536"
+config BR2_bf537
+	bool "bf537"
+config BR2_bf538
+	bool "bf538"
+config BR2_bf539
+	bool "bf539"
+config BR2_bf542
+	bool "bf542"
+config BR2_bf544
+	bool "bf544"
+config BR2_bf547
+	bool "bf547"
+config BR2_bf548
+	bool "bf548"
+config BR2_bf549
+	bool "bf549"
+config BR2_bf561
+	bool "bf561"
 endchoice
 
 config BR2_ARCH
@@ -14,3 +67,33 @@ config BR2_ARCH
 
 config BR2_ENDIAN
         default "LITTLE"
+
+config BR2_GCC_TARGET_CPU
+	default bf606		if BR2_bf606
+	default bf607		if BR2_bf607
+	default bf608		if BR2_bf608
+	default bf609		if BR2_bf609
+	default bf512		if BR2_bf512
+	default bf514		if BR2_bf514
+	default bf516		if BR2_bf516
+	default bf518		if BR2_bf518
+	default bf522		if BR2_bf522
+	default bf523		if BR2_bf523
+	default bf524		if BR2_bf524
+	default bf525		if BR2_bf525
+	default bf526		if BR2_bf526
+	default bf527		if BR2_bf527
+	default bf531		if BR2_bf531
+	default bf532		if BR2_bf532
+	default bf533		if BR2_bf533
+	default bf534		if BR2_bf534
+	default bf536		if BR2_bf536
+	default bf537		if BR2_bf537
+	default bf538		if BR2_bf538
+	default bf539		if BR2_bf539
+	default bf542		if BR2_bf542
+	default bf544		if BR2_bf544
+	default bf547		if BR2_bf547
+	default bf548		if BR2_bf548
+	default bf549		if BR2_bf549
+	default bf561		if BR2_bf561
-- 
1.7.0.4

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

* [Buildroot] [PATCH v2 2/7] arch: toolchain: Introduce target CPU revision.
  2013-03-29  9:50 [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice Sonic Zhang
@ 2013-03-29  9:50 ` Sonic Zhang
  2013-04-07 20:42   ` Thomas Petazzoni
  2013-03-29  9:50 ` [Buildroot] [PATCH v2 3/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 30+ messages in thread
From: Sonic Zhang @ 2013-03-29  9:50 UTC (permalink / raw)
  To: buildroot

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

v2-changes:
none

v1-changes:
- Adds the possibility to have a free-form CPU revision string and append it
to the target CPU. Only Blackfin actually uses this option.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 arch/Config.in                           |    3 +++
 arch/Config.in.bfin                      |    5 +++++
 toolchain/toolchain-external/ext-tool.mk |    4 ++++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/Config.in b/arch/Config.in
index 472b10c..c341848 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -174,6 +174,9 @@ config BR2_GCC_TARGET_ABI
 config BR2_GCC_TARGET_CPU
 	string
 
+config BR2_GCC_TARGET_CPU_REVISION
+	string
+
 if BR2_arm || BR2_armeb
 source "arch/Config.in.arm"
 endif
diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
index ac96620..021f5fe 100644
--- a/arch/Config.in.bfin
+++ b/arch/Config.in.bfin
@@ -97,3 +97,8 @@ config BR2_GCC_TARGET_CPU
 	default bf548		if BR2_bf548
 	default bf549		if BR2_bf549
 	default bf561		if BR2_bf561
+
+config BR2_GCC_TARGET_CPU_REVISION
+	string "Target CPU revision"
+	help
+	  Specify target cpu revision which is passed to compiler as a parameter.
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index b477bc0..407e1ad 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -134,7 +134,11 @@ TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += \
 endif
 
 CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE))
+ifeq ($(BR2_GCC_TARGET_CPU_REVISION),)
 CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU))
+else
+CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))
+endif
 CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
 CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))
 
-- 
1.7.0.4

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

* [Buildroot] [PATCH v2 3/7] arch: toolchain: Introduce binary formats BINFMT_*.
  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-03-29  9:50 ` Sonic Zhang
  2013-04-07 20:45   ` Thomas Petazzoni
  2013-04-07 20:47   ` Thomas Petazzoni
  2013-03-29  9:50 ` [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types Sonic Zhang
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 30+ messages in thread
From: Sonic Zhang @ 2013-03-29  9:50 UTC (permalink / raw)
  To: buildroot

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

v2-changes:
none

v1-changes:
- Just introduce the symbol and options in arch generic Config.in.
Append FLAT format link flags to external toolchain wrapper.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 arch/Config.in                                     |   13 +++++++++++++
 toolchain/toolchain-external/ext-tool.mk           |    4 ++++
 .../toolchain-external/ext-toolchain-wrapper.c     |    3 +++
 3 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/Config.in b/arch/Config.in
index c341848..be475c0 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -177,6 +177,19 @@ config BR2_GCC_TARGET_CPU
 config BR2_GCC_TARGET_CPU_REVISION
 	string
 
+# Set up target binary format
+choice
+	prompt "Target Binary Format"
+	default BR2_BINFMT_ELF
+config BR2_BINFMT_ELF
+	bool "ELF"
+config BR2_BINFMT_FDPIC
+	bool "FDPIC"
+config BR2_BINFMT_FLAT
+	bool "FLAT"
+	select BR2_PREFER_STATIC_LIB
+endchoice
+
 if BR2_arm || BR2_armeb
 source "arch/Config.in.arm"
 endif
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 407e1ad..27fd296 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -164,6 +164,10 @@ ifneq ($(CC_TARGET_ABI_),)
 TOOLCHAIN_EXTERNAL_CFLAGS += -mabi=$(CC_TARGET_ABI_)
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_ABI='"$(CC_TARGET_ABI_)"'
 endif
+ifeq ($(BR2_BINFMT_FLAT),y)
+TOOLCHAIN_EXTERNAL_CFLAGS += -Wl,-elf2flt
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT
+endif
 
 ifneq ($(BR2_TARGET_OPTIMIZATION),)
 TOOLCHAIN_EXTERNAL_CFLAGS += $(call qstrip,$(BR2_TARGET_OPTIMIZATION))
diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c
index a92bada..9a2fc70 100644
--- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
+++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
@@ -47,6 +47,9 @@ static char *predef_args[] = {
 #ifdef BR_64
 	"-m64",
 #endif
+#ifdef BR_BINFMT_FLAT
+	"-Wl,-elf2flt",
+#endif
 #ifdef BR_ADDITIONAL_CFLAGS
 	BR_ADDITIONAL_CFLAGS
 #endif
-- 
1.7.0.4

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

* [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types.
  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-03-29  9:50 ` [Buildroot] [PATCH v2 3/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
@ 2013-03-29  9:50 ` Sonic Zhang
  2013-04-07 20:51   ` Thomas Petazzoni
  2013-03-29  9:50 ` [Buildroot] [PATCH v2 5/7] package: Introduce package-specific BINFMT_FLAT options Sonic Zhang
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 30+ messages in thread
From: Sonic Zhang @ 2013-03-29  9:50 UTC (permalink / raw)
  To: buildroot

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

v2-changes:
none

v1-changes:
- Just introduce the symbol and options in arch generic Config.in.
Append FLAT types specific link flags into external toolchain wrapper.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 arch/Config.in                                     |   13 +++++++++++++
 toolchain/toolchain-external/ext-tool.mk           |    8 ++++++++
 .../toolchain-external/ext-toolchain-wrapper.c     |    6 ++++++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/Config.in b/arch/Config.in
index be475c0..cf081a3 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -190,6 +190,19 @@ config BR2_BINFMT_FLAT
 	select BR2_PREFER_STATIC_LIB
 endchoice
 
+# Set up flat binary type
+choice
+	prompt "FLAT Binary type"
+	depends on BR2_BINFMT_FLAT
+	default BR2_BINFMT_FLAT_ONE
+config BR2_BINFMT_FLAT_ONE
+	bool "One binary"
+config BR2_BINFMT_FLAT_SEP_DATA
+	bool "Separate data and code"
+config BR2_BINFMT_FLAT_SHARED
+	bool "Shared binary"
+endchoice
+
 if BR2_arm || BR2_armeb
 source "arch/Config.in.arm"
 endif
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 27fd296..0ca1307 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -168,6 +168,14 @@ ifeq ($(BR2_BINFMT_FLAT),y)
 TOOLCHAIN_EXTERNAL_CFLAGS += -Wl,-elf2flt
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT
 endif
+ifeq ($(BR2_BINFMT_FLAT_SEP_DATA),y)
+TOOLCHAIN_EXTERNAL_CFLAGS += -msep-data
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT_SEP_DATA
+endif
+ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
+TOOLCHAIN_EXTERNAL_CFLAGS += -mid-shared-library -mshared-library-id=0
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT_SHARED
+endif
 
 ifneq ($(BR2_TARGET_OPTIMIZATION),)
 TOOLCHAIN_EXTERNAL_CFLAGS += $(call qstrip,$(BR2_TARGET_OPTIMIZATION))
diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c
index 9a2fc70..c0eb2db 100644
--- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
+++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
@@ -50,6 +50,12 @@ static char *predef_args[] = {
 #ifdef BR_BINFMT_FLAT
 	"-Wl,-elf2flt",
 #endif
+#ifdef BR_BINFMT_FLAT_SEP_DATA
+	"-msep-data",
+#endif
+#ifdef BR_BINFMT_FLAT_SHARED
+	"-mid-shared-library -mshared-library-id=0",
+#endif
 #ifdef BR_ADDITIONAL_CFLAGS
 	BR_ADDITIONAL_CFLAGS
 #endif
-- 
1.7.0.4

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

* [Buildroot] [PATCH v2 5/7] package: Introduce package-specific BINFMT_FLAT options.
  2013-03-29  9:50 [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice Sonic Zhang
                   ` (2 preceding siblings ...)
  2013-03-29  9:50 ` [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types Sonic Zhang
@ 2013-03-29  9:50 ` Sonic Zhang
  2013-04-07 21:27   ` Thomas Petazzoni
  2013-03-29  9:50 ` [Buildroot] [PATCH v2 6/7] arch: Introduce blackfin-specific Makefile Sonic Zhang
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 30+ messages in thread
From: Sonic Zhang @ 2013-03-29  9:50 UTC (permalink / raw)
  To: buildroot

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

v2-changes:
- Fix typo error in macro BINFMT_FLAT

v1-changes:
- Add new option <PKG>_FLAT_STACKSIZE. The document needs to be updated.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 package/pkg-autotools.mk |    5 +++++
 package/pkg-generic.mk   |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index 890506b..bdfea20 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -82,6 +82,11 @@ $(2)_CLEAN_OPT			?= clean
 $(2)_UNINSTALL_STAGING_OPT	?= DESTDIR=$$(STAGING_DIR) uninstall
 $(2)_UNINSTALL_TARGET_OPT	?= DESTDIR=$$(TARGET_DIR)  uninstall
 
+ifeq ($(BR2_BINFMT_FLAT),y)
+ ifneq ($$($(2)_FLAT_STACKSIZE),)
+  $(2)_CONF_ENV			+= LDFLAGS="$(TARGET_LDFLAGS) -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)"
+ endif
+endif
 
 #
 # Configure step. Only define it if not already defined by the package
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 57b0fd0..8ee2b20 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -303,6 +303,11 @@ endif
 
 $(2)_REDISTRIBUTE		?= YES
 
+ifeq ($(BR2_BINFMT_FLAT),y)
+ ifneq ($$($(2)_FLAT_STACKSIZE),)
+  $(2)_FLAT_LDFLAGS = -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)
+ endif
+endif
 
 $(2)_DEPENDENCIES ?= $(filter-out $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
 
-- 
1.7.0.4

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

* [Buildroot] [PATCH v2 6/7] arch: Introduce blackfin-specific Makefile
  2013-03-29  9:50 [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice Sonic Zhang
                   ` (3 preceding siblings ...)
  2013-03-29  9:50 ` [Buildroot] [PATCH v2 5/7] package: Introduce package-specific BINFMT_FLAT options Sonic Zhang
@ 2013-03-29  9:50 ` Sonic Zhang
  2013-04-07 21:41   ` 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
  6 siblings, 1 reply; 30+ messages in thread
From: Sonic Zhang @ 2013-03-29  9:50 UTC (permalink / raw)
  To: buildroot

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

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

* [Buildroot] [PATCH v2 7/7] package: Introduce NOMMU symbol
  2013-03-29  9:50 [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice Sonic Zhang
                   ` (4 preceding siblings ...)
  2013-03-29  9:50 ` [Buildroot] [PATCH v2 6/7] arch: Introduce blackfin-specific Makefile Sonic Zhang
@ 2013-03-29  9:50 ` Sonic Zhang
  2013-04-07 20:39 ` [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice Thomas Petazzoni
  6 siblings, 0 replies; 30+ messages in thread
From: Sonic Zhang @ 2013-03-29  9:50 UTC (permalink / raw)
  To: buildroot

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

v2-changes:
none

v1-chagnes:
- Introduce NOMMU symbol __NOMMU__

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 package/Makefile.in |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index a8bf36b..3a26b09 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -103,6 +103,10 @@ TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET
 TARGET_CXXFLAGS = $(TARGET_CFLAGS)
 TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 
+ifneq ($(BR2_USE_MMU), y)
+TARGET_CFLAGS += -D__NOMMU__
+endif
+
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y)
 TARGET_CROSS=$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-
 else
-- 
1.7.0.4

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

* [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice.
  2013-03-29  9:50 [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice Sonic Zhang
                   ` (5 preceding siblings ...)
  2013-03-29  9:50 ` [Buildroot] [PATCH v2 7/7] package: Introduce NOMMU symbol Sonic Zhang
@ 2013-04-07 20:39 ` Thomas Petazzoni
  2013-04-08  3:28   ` Sonic Zhang
  6 siblings, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-04-07 20:39 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

Thanks for continuing the work on this!

On Fri, 29 Mar 2013 17:50:37 +0800, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> v2-changes:
> none
> 
> v1-changes:
> - is patch adds a Target CPU configuration option and uses it to select a -m
> option for gcc.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> ---
>  arch/Config.in.bfin |   97 +++++++++++++++++++++++++++++++++++++++++++++++----
>  1 files changed, 90 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
> index 0b137ae..ac96620 100644
> --- a/arch/Config.in.bfin
> +++ b/arch/Config.in.bfin
> @@ -1,12 +1,65 @@
>  choice
> -	prompt "Target ABI"
> +	prompt "Target CPU"
>  	depends on BR2_bfin
> -	default BR2_BFIN_FDPIC
> -config BR2_BFIN_FDPIC
> -	bool "FDPIC"
> -config BR2_BFIN_FLAT
> -	bool "FLAT"
> -	select BR2_PREFER_STATIC_LIB

You can't just remove BR2_BFIN_FDPIC and BR2_BFIN_FLAT, they are used
in the external toolchain logic of Buildroot:

$ git grep BR2_BFIN_FDPIC .
arch/Config.in.bfin:	default BR2_BFIN_FDPIC
arch/Config.in.bfin:config BR2_BFIN_FDPIC
toolchain/toolchain-external/Config.in:	default "bfin-uclinux"		 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1 && !BR2_BFIN_FDPIC
toolchain/toolchain-external/Config.in:	default "bfin-linux-uclibc"	 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1 && BR2_BFIN_FDPIC
toolchain/toolchain-external/Config.in:	default "bfin-uclinux"		 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1 && !BR2_BFIN_FDPIC
toolchain/toolchain-external/Config.in:	default "bfin-linux-uclibc"	 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1 && BR2_BFIN_FDPIC
toolchain/toolchain-external/Config.in:	default "bfin-uclinux"		 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2 && !BR2_BFIN_FDPIC
toolchain/toolchain-external/Config.in:	default "bfin-linux-uclibc"	 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2 && BR2_BFIN_FDPIC

So, I think your patch 3/7 should be first in the series, and it should
be followed by a patch that removes BR2_BFIN_FDPIC and BR2_BFIN_FLAT
and use the new BR2_BINFMT_* symbols in the external toolchain logic.

Basically, your patch set should not break things! When you remove a
symbol, make sure it isn't used anymore.

Other than that, I'm fine with this patch adding the blackfin CPU variants.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v2 2/7] arch: toolchain: Introduce target CPU revision.
  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
  0 siblings, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-04-07 20:42 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 29 Mar 2013 17:50:38 +0800, Sonic Zhang wrote:

> +config BR2_GCC_TARGET_CPU_REVISION
> +	string "Target CPU revision"
> +	help
> +	  Specify target cpu revision which is passed to compiler as a parameter.

I think this line is slightly too long, it should be wrapped. And I
would like more details here in the help text. Maybe something like:

	Specify a target CPU revision, which will be appended to the
	value of the -mcpu option. For example, if the selected CPU is
	bf607, and then selected CPU revision is "r2", then gcc will
	receive the -mcpu=bf607-r2 option.

Other than this detail, looks good to me.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v2 3/7] arch: toolchain: Introduce binary formats BINFMT_*.
  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
  1 sibling, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-04-07 20:45 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 29 Mar 2013 17:50:39 +0800, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> v2-changes:
> none
> 
> v1-changes:
> - Just introduce the symbol and options in arch generic Config.in.
> Append FLAT format link flags to external toolchain wrapper.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

As detailed in my comments to PATCH 1/7, this patch needs to be
refactored with BR2_BFIN_FDPIC/BR2_BFIN_FLAT to avoid breaking existing
code.

Also, I believe we want to add some architecture dependencies here. For
the beginning, we at least want something like:

+# Set up target binary format
+choice
+	prompt "Target Binary Format"
+	default BR2_BINFMT_ELF
+config BR2_BINFMT_ELF
+	bool "ELF"
+	depends on !BR2_bfin
+config BR2_BINFMT_FDPIC
+	bool "FDPIC"
+	depends on BR2_bfin
+config BR2_BINFMT_FLAT
+	bool "FLAT"
+	select BR2_PREFER_STATIC_LIB
+	depends on BR2_bfin
+endchoice

Of course, this might be extended later on if we enable FLAT support on
other architectures. But for now, it ensures that users can't make an
invalid choice (like chose FDPIC on ARM).

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v2 3/7] arch: toolchain: Introduce binary formats BINFMT_*.
  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-07 20:47   ` Thomas Petazzoni
  2013-04-08  6:04     ` Sonic Zhang
  1 sibling, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-04-07 20:47 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 29 Mar 2013 17:50:39 +0800, Sonic Zhang wrote:

> +choice
> +	prompt "Target Binary Format"
> +	default BR2_BINFMT_ELF
> +config BR2_BINFMT_ELF
> +	bool "ELF"
> +config BR2_BINFMT_FDPIC
> +	bool "FDPIC"
> +config BR2_BINFMT_FLAT
> +	bool "FLAT"
> +	select BR2_PREFER_STATIC_LIB
> +endchoice

Maybe some help text would also be nice for each choice.

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types.
  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
  0 siblings, 2 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2013-04-07 20:51 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 29 Mar 2013 17:50:40 +0800, Sonic Zhang wrote:

> +# Set up flat binary type
> +choice
> +	prompt "FLAT Binary type"
> +	depends on BR2_BINFMT_FLAT
> +	default BR2_BINFMT_FLAT_ONE
> +config BR2_BINFMT_FLAT_ONE
> +	bool "One binary"
> +config BR2_BINFMT_FLAT_SEP_DATA
> +	bool "Separate data and code"

	depends on BR2_bfin || BR2_m68k

I know I've suggested on PATCH 3/7 to make FLAT depend on bfin, so
technically this isn't needed. But since -msep-data is really an option
that is only available on bfin and m68k, while the flat format can be
used potentially on other architectures, I'd prefer to make this
architecture dependency explicit here as well.

> +config BR2_BINFMT_FLAT_SHARED
> +	bool "Shared binary"

	depends on BR2_bfin || BR2_m68k

Same reason: -mid-shared-library is only available for Blackfin and
m68k.

> +endchoice

I would have originally thought of putting those choices directly
within the list of BR2_BINFMT_* (i.e have a list containing elf, fdpic,
flat-one, flat-sep-data, flat-shared). But maybe it makes more sense
the way you did, some I'm fine with that.

Having some help text for each choice would be nice.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v2 5/7] package: Introduce package-specific BINFMT_FLAT options.
  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
  0 siblings, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-04-07 21:27 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 29 Mar 2013 17:50:41 +0800, Sonic Zhang wrote:

> diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
> index 890506b..bdfea20 100644
> --- a/package/pkg-autotools.mk
> +++ b/package/pkg-autotools.mk
> @@ -82,6 +82,11 @@ $(2)_CLEAN_OPT			?= clean
>  $(2)_UNINSTALL_STAGING_OPT	?= DESTDIR=$$(STAGING_DIR) uninstall
>  $(2)_UNINSTALL_TARGET_OPT	?= DESTDIR=$$(TARGET_DIR)  uninstall
>  
> +ifeq ($(BR2_BINFMT_FLAT),y)
> + ifneq ($$($(2)_FLAT_STACKSIZE),)
> +  $(2)_CONF_ENV			+= LDFLAGS="$(TARGET_LDFLAGS) -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)"
> + endif
> +endif
>  
>  #
>  # Configure step. Only define it if not already defined by the package
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 57b0fd0..8ee2b20 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -303,6 +303,11 @@ endif
>  
>  $(2)_REDISTRIBUTE		?= YES
>  
> +ifeq ($(BR2_BINFMT_FLAT),y)
> + ifneq ($$($(2)_FLAT_STACKSIZE),)
> +  $(2)_FLAT_LDFLAGS = -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)
> + endif
> +endif
>  
>  $(2)_DEPENDENCIES ?= $(filter-out $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))

I understand the problem but I'm still not really happy with the
solution here. Maybe Arnout will have some suggestions.

The problem I see with the pkg-autotools change is that some packages
already override LDFLAGS in their <pkg>_CONF_ENV. For example:

NDISC6_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -lintl"

Since your <pkg>_CONF_ENV += assignment will be done after the ones
coming from the package .mk file, you're going to remove the -lintl
that had been added by the package.

For the pkg-generic change, I'm not entirely happy because it means
each and every package should use <pkg>_FLAT_LDFLAGS, while we have
told for a long time our packagers to just use $(TARGET_CONFIGURE_OPTS)
to get all the right compiler/linker flags.

So I think it seems we somehow need to make $(TARGET_LDFLAGS) a
per-package variable? Arnout what do you think about this? Do you have
ideas?

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v2 6/7] arch: Introduce blackfin-specific Makefile
  2013-03-29  9:50 ` [Buildroot] [PATCH v2 6/7] arch: Introduce blackfin-specific Makefile Sonic Zhang
@ 2013-04-07 21:41   ` Thomas Petazzoni
  2013-04-08  7:19     ` Sonic Zhang
  0 siblings, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-04-07 21:41 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 29 Mar 2013 17:50:42 +0800, Sonic Zhang wrote:

> +config BR2_BFIN_INSTALL_FDPIC_SHARED
> +	depends on BR2_bfin && !BR2_BINFMT_FDPIC
> +	bool "Install FDPIC shared libraries"
> +	default y

Any reason to have this default to y ?

> +	help
> +	  Blackfin Linux kernel supports running both FDPIC and FLAT applications

	  The Blackfin Linux kernel ...

> +	  concurrently if the binary format specific libraries installed properly.

							are installed properly.

> +	  This option allow developer to install FDPIC libraries into a buildroot

			allows the developer

> +	  rootfs image built with binary format macro other than BR2_BINFMT_FDPIC.

			built with a binary format that is not 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.

Same typos.

> 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

I am still not happy with this, because it simply doesn't work unless
you have the Blackfin toolchain installed globally on your system,
which simply isn't the case for normal users.

So I believe we should extend the external toolchain logic to be able
to use three variants of the Blackfin toolchain:

	* Only FDPIC
	* Only FLAT
	* Both FLAT and FDPIC

And then, this logic should be moved in the external toolchain logic,
where we already do the process of copying libraries from the toolchain
to the target, and from the toolchain to the staging directory.

Also:

 * $(CPUFLAGS) isn't defined anywhere

 * the logic to determine which .so files to copy should use the
   $(LIB_EXTERNAL_LIBS) and $(USR_LIB_EXTERNAL_LIBS) that we already
   use in ext-tool.mk.

 * I don't quite understand the logic you're using for the shared flat
   library copying. You use -print-file-name=libc, but then you copy it
   under the name 'lib1.so'. I think a comment above this part would be
   useful.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice.
  2013-04-07 20:39 ` [Buildroot] [PATCH v2 1/7] arch: Add blackfin CPU choice Thomas Petazzoni
@ 2013-04-08  3:28   ` Sonic Zhang
  0 siblings, 0 replies; 30+ messages in thread
From: Sonic Zhang @ 2013-04-08  3:28 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Mon, Apr 8, 2013 at 4:39 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> Thanks for continuing the work on this!
>
> On Fri, 29 Mar 2013 17:50:37 +0800, Sonic Zhang wrote:
>> From: Sonic Zhang <sonic.zhang@analog.com>
>>
>> v2-changes:
>> none
>>
>> v1-changes:
>> - is patch adds a Target CPU configuration option and uses it to select a -m
>> option for gcc.
>>
>> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
>> ---
>>  arch/Config.in.bfin |   97 +++++++++++++++++++++++++++++++++++++++++++++++----
>>  1 files changed, 90 insertions(+), 7 deletions(-)
>>
>> diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
>> index 0b137ae..ac96620 100644
>> --- a/arch/Config.in.bfin
>> +++ b/arch/Config.in.bfin
>> @@ -1,12 +1,65 @@
>>  choice
>> -     prompt "Target ABI"
>> +     prompt "Target CPU"
>>       depends on BR2_bfin
>> -     default BR2_BFIN_FDPIC
>> -config BR2_BFIN_FDPIC
>> -     bool "FDPIC"
>> -config BR2_BFIN_FLAT
>> -     bool "FLAT"
>> -     select BR2_PREFER_STATIC_LIB
>
> You can't just remove BR2_BFIN_FDPIC and BR2_BFIN_FLAT, they are used
> in the external toolchain logic of Buildroot:
>
> $ git grep BR2_BFIN_FDPIC .
> arch/Config.in.bfin:    default BR2_BFIN_FDPIC
> arch/Config.in.bfin:config BR2_BFIN_FDPIC
> toolchain/toolchain-external/Config.in: default "bfin-uclinux"           if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1 && !BR2_BFIN_FDPIC
> toolchain/toolchain-external/Config.in: default "bfin-linux-uclibc"      if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1 && BR2_BFIN_FDPIC
> toolchain/toolchain-external/Config.in: default "bfin-uclinux"           if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1 && !BR2_BFIN_FDPIC
> toolchain/toolchain-external/Config.in: default "bfin-linux-uclibc"      if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1 && BR2_BFIN_FDPIC
> toolchain/toolchain-external/Config.in: default "bfin-uclinux"           if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2 && !BR2_BFIN_FDPIC
> toolchain/toolchain-external/Config.in: default "bfin-linux-uclibc"      if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2 && BR2_BFIN_FDPIC
>
> So, I think your patch 3/7 should be first in the series, and it should
> be followed by a patch that removes BR2_BFIN_FDPIC and BR2_BFIN_FLAT
> and use the new BR2_BINFMT_* symbols in the external toolchain logic.
>

OK. I will move 3/7 ahead.

Regards,

Sonic

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

* [Buildroot] [PATCH v2 3/7] arch: toolchain: Introduce binary formats BINFMT_*.
  2013-04-07 20:45   ` Thomas Petazzoni
@ 2013-04-08  6:03     ` Sonic Zhang
  0 siblings, 0 replies; 30+ messages in thread
From: Sonic Zhang @ 2013-04-08  6:03 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Mon, Apr 8, 2013 at 4:45 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> On Fri, 29 Mar 2013 17:50:39 +0800, Sonic Zhang wrote:
>> From: Sonic Zhang <sonic.zhang@analog.com>
>>
>> v2-changes:
>> none
>>
>> v1-changes:
>> - Just introduce the symbol and options in arch generic Config.in.
>> Append FLAT format link flags to external toolchain wrapper.
>>
>> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
>
> As detailed in my comments to PATCH 1/7, this patch needs to be
> refactored with BR2_BFIN_FDPIC/BR2_BFIN_FLAT to avoid breaking existing
> code.

OK.

>
> Also, I believe we want to add some architecture dependencies here. For
> the beginning, we at least want something like:
>
> +# Set up target binary format
> +choice
> +       prompt "Target Binary Format"
> +       default BR2_BINFMT_ELF
> +config BR2_BINFMT_ELF
> +       bool "ELF"
> +       depends on !BR2_bfin
> +config BR2_BINFMT_FDPIC
> +       bool "FDPIC"
> +       depends on BR2_bfin
> +config BR2_BINFMT_FLAT
> +       bool "FLAT"
> +       select BR2_PREFER_STATIC_LIB
> +       depends on BR2_bfin
> +endchoice
>

No problem.

Regards,

Sonic

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

* [Buildroot] [PATCH v2 3/7] arch: toolchain: Introduce binary formats BINFMT_*.
  2013-04-07 20:47   ` Thomas Petazzoni
@ 2013-04-08  6:04     ` Sonic Zhang
  0 siblings, 0 replies; 30+ messages in thread
From: Sonic Zhang @ 2013-04-08  6:04 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Mon, Apr 8, 2013 at 4:47 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> On Fri, 29 Mar 2013 17:50:39 +0800, Sonic Zhang wrote:
>
>> +choice
>> +     prompt "Target Binary Format"
>> +     default BR2_BINFMT_ELF
>> +config BR2_BINFMT_ELF
>> +     bool "ELF"
>> +config BR2_BINFMT_FDPIC
>> +     bool "FDPIC"
>> +config BR2_BINFMT_FLAT
>> +     bool "FLAT"
>> +     select BR2_PREFER_STATIC_LIB
>> +endchoice
>
> Maybe some help text would also be nice for each choice.
>
OK

Regards,

Sonic

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

* [Buildroot] [PATCH v2 2/7] arch: toolchain: Introduce target CPU revision.
  2013-04-07 20:42   ` Thomas Petazzoni
@ 2013-04-08  6:30     ` Sonic Zhang
  0 siblings, 0 replies; 30+ messages in thread
From: Sonic Zhang @ 2013-04-08  6:30 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Mon, Apr 8, 2013 at 4:42 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> On Fri, 29 Mar 2013 17:50:38 +0800, Sonic Zhang wrote:
>
>> +config BR2_GCC_TARGET_CPU_REVISION
>> +     string "Target CPU revision"
>> +     help
>> +       Specify target cpu revision which is passed to compiler as a parameter.
>
> I think this line is slightly too long, it should be wrapped. And I
> would like more details here in the help text. Maybe something like:
>
>         Specify a target CPU revision, which will be appended to the
>         value of the -mcpu option. For example, if the selected CPU is
>         bf607, and then selected CPU revision is "r2", then gcc will
>         receive the -mcpu=bf607-r2 option.
>
OK.

Regards,

Sonic

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

* [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types.
  2013-04-07 20:51   ` Thomas Petazzoni
@ 2013-04-08  6:43     ` Sonic Zhang
  2013-04-12  3:39     ` Sonic Zhang
  1 sibling, 0 replies; 30+ messages in thread
From: Sonic Zhang @ 2013-04-08  6:43 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Mon, Apr 8, 2013 at 4:51 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> On Fri, 29 Mar 2013 17:50:40 +0800, Sonic Zhang wrote:
>
>> +# Set up flat binary type
>> +choice
>> +     prompt "FLAT Binary type"
>> +     depends on BR2_BINFMT_FLAT
>> +     default BR2_BINFMT_FLAT_ONE
>> +config BR2_BINFMT_FLAT_ONE
>> +     bool "One binary"
>> +config BR2_BINFMT_FLAT_SEP_DATA
>> +     bool "Separate data and code"
>
>         depends on BR2_bfin || BR2_m68k
>
> I know I've suggested on PATCH 3/7 to make FLAT depend on bfin, so
> technically this isn't needed. But since -msep-data is really an option
> that is only available on bfin and m68k, while the flat format can be
> used potentially on other architectures, I'd prefer to make this
> architecture dependency explicit here as well.
>
>> +config BR2_BINFMT_FLAT_SHARED
>> +     bool "Shared binary"
>
>         depends on BR2_bfin || BR2_m68k
>
> Same reason: -mid-shared-library is only available for Blackfin and
> m68k.

OK.

>
>> +endchoice
>
> I would have originally thought of putting those choices directly
> within the list of BR2_BINFMT_* (i.e have a list containing elf, fdpic,
> flat-one, flat-sep-data, flat-shared). But maybe it makes more sense
> the way you did, some I'm fine with that.
>
> Having some help text for each choice would be nice.
>
OK.

Regards,

Sonic

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

* [Buildroot] [PATCH v2 6/7] arch: Introduce blackfin-specific Makefile
  2013-04-07 21:41   ` Thomas Petazzoni
@ 2013-04-08  7:19     ` Sonic Zhang
  2013-04-08 21:23       ` Thomas Petazzoni
  0 siblings, 1 reply; 30+ messages in thread
From: Sonic Zhang @ 2013-04-08  7:19 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Mon, Apr 8, 2013 at 5:41 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> On Fri, 29 Mar 2013 17:50:42 +0800, Sonic Zhang wrote:
>
>> +config BR2_BFIN_INSTALL_FDPIC_SHARED
>> +     depends on BR2_bfin && !BR2_BINFMT_FDPIC
>> +     bool "Install FDPIC shared libraries"
>> +     default y
>
> Any reason to have this default to y ?

No. Can be removed.

>
>> +     help
>> +       Blackfin Linux kernel supports running both FDPIC and FLAT applications
>
>           The Blackfin Linux kernel ...
>
>> +       concurrently if the binary format specific libraries installed properly.
>
>                                                         are installed properly.
>
>> +       This option allow developer to install FDPIC libraries into a buildroot
>
>                         allows the developer
>
>> +       rootfs image built with binary format macro other than BR2_BINFMT_FDPIC.
>
>                         built with a binary format that is not 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.
>
> Same typos.

Thanks.

>
>> 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
>
> I am still not happy with this, because it simply doesn't work unless
> you have the Blackfin toolchain installed globally on your system,
> which simply isn't the case for normal users.
>
> So I believe we should extend the external toolchain logic to be able
> to use three variants of the Blackfin toolchain:
>
>         * Only FDPIC
>         * Only FLAT
>         * Both FLAT and FDPIC
>
> And then, this logic should be moved in the external toolchain logic,
> where we already do the process of copying libraries from the toolchain
> to the target, and from the toolchain to the staging directory.

Since FPDIC libraries are installed by default if BINFMT_FDPIC is
selected, how about making INSTALL_FDPIC_LIB option depend on
BINFMT_FLAT only? So do the INSTALL_FLAT_LIB option. And no "Both FLAT
and FDPIC" is needed in this case.

>
> Also:
>
>  * $(CPUFLAGS) isn't defined anywhere

Yes, forgot to define it after switching to the toolchain wrapper solution.

>  * the logic to determine which .so files to copy should use the
>    $(LIB_EXTERNAL_LIBS) and $(USR_LIB_EXTERNAL_LIBS) that we already
>    use in ext-tool.mk.

This only applies to the FDPIC libraries. The FLAT libraries use a
different name policy.

>  * I don't quite understand the logic you're using for the shared flat
>    library copying. You use -print-file-name=libc, but then you copy it
>    under the name 'lib1.so'. I think a comment above this part would be
>    useful.

The flat libraries are found and linked according to the index in it
name "libN.so". Index 1 is reserved for the standard C library.
Customer libraries can use 4 and above. That's why the libc is renamed
to lib1.so in target rootfs.

Regards,

Sonic.

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

* [Buildroot] [PATCH v2 6/7] arch: Introduce blackfin-specific Makefile
  2013-04-08  7:19     ` Sonic Zhang
@ 2013-04-08 21:23       ` Thomas Petazzoni
  0 siblings, 0 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2013-04-08 21:23 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Mon, 8 Apr 2013 15:19:18 +0800, Sonic Zhang wrote:
> > I am still not happy with this, because it simply doesn't work unless
> > you have the Blackfin toolchain installed globally on your system,
> > which simply isn't the case for normal users.
> >
> > So I believe we should extend the external toolchain logic to be able
> > to use three variants of the Blackfin toolchain:
> >
> >         * Only FDPIC
> >         * Only FLAT
> >         * Both FLAT and FDPIC
> >
> > And then, this logic should be moved in the external toolchain logic,
> > where we already do the process of copying libraries from the toolchain
> > to the target, and from the toolchain to the staging directory.
> 
> Since FPDIC libraries are installed by default if BINFMT_FDPIC is
> selected, how about making INSTALL_FDPIC_LIB option depend on
> BINFMT_FLAT only? So do the INSTALL_FLAT_LIB option.

Yes, this makes sense.

> And no "Both FLAT and FDPIC" is needed in this case.

In fact, I looked again at our support for Blackfin external
toolchains, and I was wrong: we always install *both* the FDPIC and
Flat shared libraries. So in fact, you don't need to handle the
variants of the external toolchain.

Just move your logic into the external toolchain logic that copies
libraries, and that should be fine. I believe it belongs to the
external toolchain logic, because it is highly specific to Analog
Devices toolchains. If we ever support Blackfin in the internal
backend, it will always either be FDPIC *or* FLAT, but not both at the
same time.

> >  * the logic to determine which .so files to copy should use the
> >    $(LIB_EXTERNAL_LIBS) and $(USR_LIB_EXTERNAL_LIBS) that we already
> >    use in ext-tool.mk.
> 
> This only applies to the FDPIC libraries. The FLAT libraries use a
> different name policy.

Yes, sure, but I was referring to the FDPIC libraries in this part
(sorry if it wasn't clear).

> >  * I don't quite understand the logic you're using for the shared flat
> >    library copying. You use -print-file-name=libc, but then you copy it
> >    under the name 'lib1.so'. I think a comment above this part would be
> >    useful.
> 
> The flat libraries are found and linked according to the index in it
> name "libN.so". Index 1 is reserved for the standard C library.
> Customer libraries can use 4 and above. That's why the libc is renamed
> to lib1.so in target rootfs.

Oh, ok, interesting. Could you just copy/paste this explanation as a
comment above the relevant part of the code?

Thanks a lot Sonic for your very quick feedback in this discussion, I
think we're making great progress!

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v2 5/7] package: Introduce package-specific BINFMT_FLAT options.
  2013-04-07 21:27   ` Thomas Petazzoni
@ 2013-04-10  5:47     ` Arnout Vandecappelle
  2013-04-10  8:10       ` Sonic Zhang
  0 siblings, 1 reply; 30+ messages in thread
From: Arnout Vandecappelle @ 2013-04-10  5:47 UTC (permalink / raw)
  To: buildroot

On 07/04/13 23:27, Thomas Petazzoni wrote:
> Dear Sonic Zhang,
>
> On Fri, 29 Mar 2013 17:50:41 +0800, Sonic Zhang wrote:
>
>> diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
>> index 890506b..bdfea20 100644
>> --- a/package/pkg-autotools.mk
>> +++ b/package/pkg-autotools.mk
>> @@ -82,6 +82,11 @@ $(2)_CLEAN_OPT			?= clean
>>   $(2)_UNINSTALL_STAGING_OPT	?= DESTDIR=$$(STAGING_DIR) uninstall
>>   $(2)_UNINSTALL_TARGET_OPT	?= DESTDIR=$$(TARGET_DIR)  uninstall
>>
>> +ifeq ($(BR2_BINFMT_FLAT),y)
>> + ifneq ($$($(2)_FLAT_STACKSIZE),)
>> +  $(2)_CONF_ENV			+= LDFLAGS="$(TARGET_LDFLAGS) -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)"
>> + endif
>> +endif
>>
>>   #
>>   # Configure step. Only define it if not already defined by the package
>> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
>> index 57b0fd0..8ee2b20 100644
>> --- a/package/pkg-generic.mk
>> +++ b/package/pkg-generic.mk
>> @@ -303,6 +303,11 @@ endif
>>
>>   $(2)_REDISTRIBUTE		?= YES
>>
>> +ifeq ($(BR2_BINFMT_FLAT),y)
>> + ifneq ($$($(2)_FLAT_STACKSIZE),)
>> +  $(2)_FLAT_LDFLAGS = -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)
>> + endif
>> +endif
>>
>>   $(2)_DEPENDENCIES ?= $(filter-out $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
>
> I understand the problem but I'm still not really happy with the
> solution here. Maybe Arnout will have some suggestions.

  I had exactly the same thoughts while reading the patch...

> The problem I see with the pkg-autotools change is that some packages
> already override LDFLAGS in their <pkg>_CONF_ENV. For example:
>
> NDISC6_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -lintl"
>
> Since your <pkg>_CONF_ENV += assignment will be done after the ones
> coming from the package .mk file, you're going to remove the -lintl
> that had been added by the package.
>
> For the pkg-generic change, I'm not entirely happy because it means
> each and every package should use <pkg>_FLAT_LDFLAGS, while we have
> told for a long time our packagers to just use $(TARGET_CONFIGURE_OPTS)
> to get all the right compiler/linker flags.
>
> So I think it seems we somehow need to make $(TARGET_LDFLAGS) a
> per-package variable? Arnout what do you think about this? Do you have
> ideas?

  In fact, it can easily be made a per-package variable. In the 
definition of TARGET_LDFLAGS, we can add:

TARGET_LDFLAGS = ... \
	$($(PKG)_LDFLAGS)

  The $(PKG) is only evaluated when the TARGET_LDFLAGS variable is used.

  Outside the scope of the generic rules, $(PKG) evaluates to nothing, 
and _LDFLAGS is not defined, so the $($(PKG)_LDFLAGS) has no effect.

  Inside the scope of the generic rules, $(PKG) is always defined. So we 
just have to add the following to the pkg-generic macro:

ifeq ($(BR2_BINFMT_FLAT),y)
   $(2)_LDFLAGS += -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)
endif


  As far as I can see, that should work nicely. No need to change 
anything in autotools. Unfortunately, it does require changing the 
packages that have something like:

DOSFSTOOLS_LDFLAGS = $(TARGET_LDFLAGS)

  Also, it is not very intuitive, because in a non-autotools package 
where you can't use the LDFLAGS environment variable, you'll have 
something like:

AXEL_LDFLAGS = -lpthread
define AXEL_BUILD_CMDS
         $(TARGET_CONFIGURE_OPTS) $(MAKE) \
         LFLAGS="$(TARGET_LDFLAGS)" -C $(@D)
endef

i.e. you're defining AXEL_LDFLAGS but using TARGET_LDFLAGS. Not a really 
big issue, I think, but not very nice either.


  For this patch list, however, I think changing the 15 uses of 
FOO_LDFLAGS is going a bit too far. So I propose to make the following 
change instead in package/Makefile.in:

ifeq ($(BR2_BINFMT_FLAT),y)
TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),\
	-Wl,-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
endif

  AFAICS, that should work for any package without any further change. 
But needs to be tested, of course...

  Regards,
  Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] [PATCH v2 5/7] package: Introduce package-specific BINFMT_FLAT options.
  2013-04-10  5:47     ` Arnout Vandecappelle
@ 2013-04-10  8:10       ` Sonic Zhang
  2013-04-10 10:36         ` Arnout Vandecappelle
  0 siblings, 1 reply; 30+ messages in thread
From: Sonic Zhang @ 2013-04-10  8:10 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

On Wed, Apr 10, 2013 at 1:47 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 07/04/13 23:27, Thomas Petazzoni wrote:
>>
>> Dear Sonic Zhang,
>>
>> On Fri, 29 Mar 2013 17:50:41 +0800, Sonic Zhang wrote:
>>
>>> diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
>>> index 890506b..bdfea20 100644
>>> --- a/package/pkg-autotools.mk
>>> +++ b/package/pkg-autotools.mk
>>> @@ -82,6 +82,11 @@ $(2)_CLEAN_OPT                       ?= clean
>>>   $(2)_UNINSTALL_STAGING_OPT    ?= DESTDIR=$$(STAGING_DIR) uninstall
>>>   $(2)_UNINSTALL_TARGET_OPT     ?= DESTDIR=$$(TARGET_DIR)  uninstall
>>>
>>> +ifeq ($(BR2_BINFMT_FLAT),y)
>>> + ifneq ($$($(2)_FLAT_STACKSIZE),)
>>> +  $(2)_CONF_ENV                        += LDFLAGS="$(TARGET_LDFLAGS)
>>> -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)"
>>> + endif
>>> +endif
>>>
>>>   #
>>>   # Configure step. Only define it if not already defined by the package
>>> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
>>> index 57b0fd0..8ee2b20 100644
>>> --- a/package/pkg-generic.mk
>>> +++ b/package/pkg-generic.mk
>>> @@ -303,6 +303,11 @@ endif
>>>
>>>   $(2)_REDISTRIBUTE             ?= YES
>>>
>>> +ifeq ($(BR2_BINFMT_FLAT),y)
>>> + ifneq ($$($(2)_FLAT_STACKSIZE),)
>>> +  $(2)_FLAT_LDFLAGS = -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)
>>> + endif
>>> +endif
>>>
>>>   $(2)_DEPENDENCIES ?= $(filter-out $(1),$(patsubst
>>> host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
>>
>>
>> I understand the problem but I'm still not really happy with the
>> solution here. Maybe Arnout will have some suggestions.
>
>
>  I had exactly the same thoughts while reading the patch...
>
>
>> The problem I see with the pkg-autotools change is that some packages
>> already override LDFLAGS in their <pkg>_CONF_ENV. For example:
>>
>> NDISC6_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -lintl"
>>
>> Since your <pkg>_CONF_ENV += assignment will be done after the ones
>> coming from the package .mk file, you're going to remove the -lintl
>> that had been added by the package.
>>
>> For the pkg-generic change, I'm not entirely happy because it means
>> each and every package should use <pkg>_FLAT_LDFLAGS, while we have
>> told for a long time our packagers to just use $(TARGET_CONFIGURE_OPTS)
>> to get all the right compiler/linker flags.
>>
>> So I think it seems we somehow need to make $(TARGET_LDFLAGS) a
>> per-package variable? Arnout what do you think about this? Do you have
>> ideas?
>
>
>  In fact, it can easily be made a per-package variable. In the definition of
> TARGET_LDFLAGS, we can add:
>
> TARGET_LDFLAGS = ... \
>         $($(PKG)_LDFLAGS)
>
>  The $(PKG) is only evaluated when the TARGET_LDFLAGS variable is used.
>
>  Outside the scope of the generic rules, $(PKG) evaluates to nothing, and
> _LDFLAGS is not defined, so the $($(PKG)_LDFLAGS) has no effect.
>
>  Inside the scope of the generic rules, $(PKG) is always defined. So we just
> have to add the following to the pkg-generic macro:
>
> ifeq ($(BR2_BINFMT_FLAT),y)
>   $(2)_LDFLAGS += -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)
> endif
>
>
>  As far as I can see, that should work nicely. No need to change anything in
> autotools. Unfortunately, it does require changing the packages that have
> something like:
>
> DOSFSTOOLS_LDFLAGS = $(TARGET_LDFLAGS)
>
>  Also, it is not very intuitive, because in a non-autotools package where
> you can't use the LDFLAGS environment variable, you'll have something like:
>
> AXEL_LDFLAGS = -lpthread
> define AXEL_BUILD_CMDS
>         $(TARGET_CONFIGURE_OPTS) $(MAKE) \
>         LFLAGS="$(TARGET_LDFLAGS)" -C $(@D)
> endef
>
> i.e. you're defining AXEL_LDFLAGS but using TARGET_LDFLAGS. Not a really big
> issue, I think, but not very nice either.
>
>
>  For this patch list, however, I think changing the 15 uses of FOO_LDFLAGS
> is going a bit too far. So I propose to make the following change instead in
> package/Makefile.in:
>
> ifeq ($(BR2_BINFMT_FLAT),y)
> TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),\
>         -Wl,-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
> endif
>

This doesn't work.

/home/sonic/projects/buildroot/output/host/usr/bin/bfin-uclinux-gcc
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-pipe -Os  -D__NOMMU__ -D__uClinux__ -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wl --static  bfin-dma.c
 -o bfin-dma
cc1: error: unrecognized command line option "-Wl"
make[1]: *** [bfin-dma] Error 1


In addition, if 2 generic makefile packages set different flat stack
sizes, are both of these stack size flags added to the same
TARGE_LDFLAGS macro with your change?

Regards,

Sonic

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

* [Buildroot] [PATCH v2 5/7] package: Introduce package-specific BINFMT_FLAT options.
  2013-04-10  8:10       ` Sonic Zhang
@ 2013-04-10 10:36         ` Arnout Vandecappelle
  0 siblings, 0 replies; 30+ messages in thread
From: Arnout Vandecappelle @ 2013-04-10 10:36 UTC (permalink / raw)
  To: buildroot

On 10/04/13 10:10, Sonic Zhang wrote:
> Hi Arnout,
>
> On Wed, Apr 10, 2013 at 1:47 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
[snip]
>> ifeq ($(BR2_BINFMT_FLAT),y)
>> TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),\
>>          -Wl,-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
>> endif
>>
>
> This doesn't work.
>
> /home/sonic/projects/buildroot/output/host/usr/bin/bfin-uclinux-gcc
> -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
> -pipe -Os  -D__NOMMU__ -D__uClinux__ -D_LARGEFILE_SOURCE
> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wl --static  bfin-dma.c
>   -o bfin-dma
> cc1: error: unrecognized command line option "-Wl"
> make[1]: *** [bfin-dma] Error 1

  Ah yes, of course, the comma. If should be:

ifeq ($(BR2_BINFMT_FLAT),y)
TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),\
         -Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
endif


> In addition, if 2 generic makefile packages set different flat stack
> sizes, are both of these stack size flags added to the same
> TARGE_LDFLAGS macro with your change?


  That is the magic of late binding in make. The value of TARGET_LDFLAGS 
is only evaluated at the time when it is used, and it is only at that 
time that the $(PKG) is expanded. And if it is used in the body of a 
pattern rule, then the expansion only takes place when the rule is 
instantiated.

  For example, there are two packages, FOO and BAR, that set 
FOO_FLAT_STACKSIZE and BAR_FLAT_STACKSIZE. They both use TARGET_LDFLAGS 
in their BUILD_CMDS. The BUILD_CMDS are used in the following pattern 
rule from pkg-generic.mk:

# Build
$(BUILD_DIR)/%/.stamp_built::
         @$(call MESSAGE,"Building")
         $($(PKG)_BUILD_CMDS)
         $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
         $(Q)touch $@

  When this rule is instantiated for package foo, then the PKG variable 
is set to FOO. So $($(PKG)_BUILD_CMDS) expands to $(FOO_BUILD_CMDS), 
which expands to something like

$(MAKE) LDFLAGS="$(TARGET_LDFLAGS)"

which expands to

make -j8 LDFLAGS="$(call qstrip,$(BR2_TARGET_LDFLAGS))\
	--static\
	$(if $($(PKG)_FLAT_STACKSIZE),\
         	-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))"

which expands to

make -j8 LDFLAGS="$(call qstrip,"")\
	--static\
	$(if $(FOO_FLAT_STACKSIZE),\
         	-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))"

which expands to

make -j8 LDFLAGS="\
	--static\
	$(if 2048,\
         	-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))"

which expands to

make -j8 LDFLAGS="\
	--static\
	-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE)"

which expands to

make -j8 LDFLAGS="\
	--static\
	-W,-elf2flt=-s$(FOO_FLAT_STACKSIZE)"

which expands to

make -j8 LDFLAGS=" --static -W,-elf2flt=-s2048"


  Regards,
  Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types.
  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
  1 sibling, 1 reply; 30+ messages in thread
From: Sonic Zhang @ 2013-04-12  3:39 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Just figure out the compiling flags for BINFMT_FLAT_SHARED and
BINFMT_FLAT_SEP can't be put into the toolchain wrapper, because these
flags are for application only, they can't be used to build Linux
kernel.

-mid-shared-library -mshared-library-id=0
-msep-data

So, I have to move them back to file package/Makefile.in .

Regards,

Sonic

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

* [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types.
  2013-04-12  3:39     ` Sonic Zhang
@ 2013-04-13 14:31       ` Thomas Petazzoni
  2013-04-16 10:26         ` Sonic Zhang
  0 siblings, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-04-13 14:31 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 12 Apr 2013 11:39:41 +0800, Sonic Zhang wrote:

> Just figure out the compiling flags for BINFMT_FLAT_SHARED and
> BINFMT_FLAT_SEP can't be put into the toolchain wrapper, because these
> flags are for application only, they can't be used to build Linux
> kernel.
> 
> -mid-shared-library -mshared-library-id=0
> -msep-data
> 
> So, I have to move them back to file package/Makefile.in .

Hum, that is not really nice, because the idea of the external
toolchain wrapper is to ensure that when the user will use
output/host/usr/bin/<arch>-gcc, he will get binaries that are built for
the same architecture/flags than the binaries built by Buildroot.
That's more or less the whole idea of the external toolchain wrapper
thing.

One option is to have something like:

ifeq ($(BR2_bfin),y)
LINUX_MAKE_FLAGS =
	KBUILD_CFLAGS = "$(TARGET_CFLAGS) -mno-id-shared-library ..."
endif

Not sure exactly if that's the right solution or not. Peter, you're the
one who did the external toolchain wrapper originally. Could you
comment on this specific issue?

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types.
  2013-04-13 14:31       ` Thomas Petazzoni
@ 2013-04-16 10:26         ` Sonic Zhang
  2013-04-16 10:46           ` Thomas Petazzoni
  0 siblings, 1 reply; 30+ messages in thread
From: Sonic Zhang @ 2013-04-16 10:26 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sat, Apr 13, 2013 at 10:31 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> On Fri, 12 Apr 2013 11:39:41 +0800, Sonic Zhang wrote:
>
>> Just figure out the compiling flags for BINFMT_FLAT_SHARED and
>> BINFMT_FLAT_SEP can't be put into the toolchain wrapper, because these
>> flags are for application only, they can't be used to build Linux
>> kernel.
>>
>> -mid-shared-library -mshared-library-id=0
>> -msep-data
>>
>> So, I have to move them back to file package/Makefile.in .
>
> Hum, that is not really nice, because the idea of the external
> toolchain wrapper is to ensure that when the user will use
> output/host/usr/bin/<arch>-gcc, he will get binaries that are built for
> the same architecture/flags than the binaries built by Buildroot.
> That's more or less the whole idea of the external toolchain wrapper
> thing.
>
> One option is to have something like:
>
> ifeq ($(BR2_bfin),y)
> LINUX_MAKE_FLAGS =
>         KBUILD_CFLAGS = "$(TARGET_CFLAGS) -mno-id-shared-library ..."
> endif
>
> Not sure exactly if that's the right solution or not. Peter, you're the
> one who did the external toolchain wrapper originally. Could you
> comment on this specific issue?
>
The LINUX_MAKE_FLAGS should not include the shared flat specific flags
"-mno-id-shared-library ...". Your suggestion doesn't work when
building Linux kernel. We need some ways to remove flags
"-mno-id-shared-library ..." from the gcc wrapper for the shared flat
binary format when building Linux kernel.

My new patch is to append the shared flat flags only when building applications.

Any better solution?

Regards,

Sonic

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

* [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types.
  2013-04-16 10:26         ` Sonic Zhang
@ 2013-04-16 10:46           ` Thomas Petazzoni
  2013-04-17  9:02             ` Sonic Zhang
  0 siblings, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-04-16 10:46 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Tue, 16 Apr 2013 18:26:22 +0800, Sonic Zhang wrote:

> > Not sure exactly if that's the right solution or not. Peter, you're the
> > one who did the external toolchain wrapper originally. Could you
> > comment on this specific issue?
> >
> The LINUX_MAKE_FLAGS should not include the shared flat specific flags
> "-mno-id-shared-library ...". Your suggestion doesn't work when
> building Linux kernel. We need some ways to remove flags
> "-mno-id-shared-library ..." from the gcc wrapper for the shared flat
> binary format when building Linux kernel.

Hm? If you pass -mno-id-shared-library after -mid-shared-library, it
will be just as if you hadn't passed the option at all. So if the
external toolchain wrapper passes -mid-shared-library, but then the
CFLAGS passed to the kernel override that by passing
-mno-id-shared-library, it will be just as if the external wrapper
hadn't passed -mid-shared-library.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types.
  2013-04-16 10:46           ` Thomas Petazzoni
@ 2013-04-17  9:02             ` Sonic Zhang
  2013-04-23  5:57               ` Sonic Zhang
  0 siblings, 1 reply; 30+ messages in thread
From: Sonic Zhang @ 2013-04-17  9:02 UTC (permalink / raw)
  To: buildroot

Hi Thomas,


On Tue, Apr 16, 2013 at 6:46 PM, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:

> Dear Sonic Zhang,
>
> On Tue, 16 Apr 2013 18:26:22 +0800, Sonic Zhang wrote:
>
> > > Not sure exactly if that's the right solution or not. Peter, you're the
> > > one who did the external toolchain wrapper originally. Could you
> > > comment on this specific issue?
> > >
> > The LINUX_MAKE_FLAGS should not include the shared flat specific flags
> > "-mno-id-shared-library ...". Your suggestion doesn't work when
> > building Linux kernel. We need some ways to remove flags
> > "-mno-id-shared-library ..." from the gcc wrapper for the shared flat
> > binary format when building Linux kernel.
>
> Hm? If you pass -mno-id-shared-library after -mid-shared-library, it
> will be just as if you hadn't passed the option at all. So if the
> external toolchain wrapper passes -mid-shared-library, but then the
> CFLAGS passed to the kernel override that by passing
> -mno-id-shared-library, it will be just as if the external wrapper
> hadn't passed -mid-shared-library.
>
>
The blackfin GNU toolchain doesn't understand flag
"-mno-shared-library-id", "-mno-shared-library-id=" and
"-mno-shared-library-id=0". Flag "-mshared-library-id=0" set in wrapper
can't be canceled by passing "-mno-shared-library-id" later in linux.mk.


ifeq ($(BR2_bfin),y)
LINUX_MAKE_FLAGS += KBUILD_CFLAGS="$(TARGET_CFLAGS) -mno-id-shared-library
-mno-shared-library-id -mno-sep-data"
endif


PATH="/home/sonic/projects/buildroot/output/host/bin:/home/sonic/projects/buildroot/output/host/usr/bin:/home/sonic/projects/buildroot/output/host/usr/sbin/:/opt/arm/bin:/opt/uclinux/bfin-elf/bin/:/opt/uclinux/bfin-uclinux/bin/:/opt/uclinux/bfin-linux-uclibc/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
PERLLIB="/home/sonic/projects/buildroot/output/host/usr/lib/perl"
/usr/bin/make -j4
O="/home/sonic/projects/buildroot/output/build/linux-custom"
HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=blackfin
INSTALL_MOD_PATH=/home/sonic/projects/buildroot/output/target
CROSS_COMPILE="
/home/sonic/projects/buildroot/output/host/usr/bin/bfin-uclinux-"
DEPMOD=/home/sonic/projects/buildroot/output/host/usr/sbin/depmod
KBUILD_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64  -pipe -Os  -D__NOMMU__ -D__uClinux__
-mno-id-shared-library -mno-shared-library-id -mno-sep-data" -C
"linux/linux-kernel"/ uImage
make[1]: Entering directory
`/home/sonic/projects/buildroot/linux/linux-kernel'
  GEN     /home/sonic/projects/buildroot/output/build/linux-custom/Makefile
  CHK     include/generated/uapi/linux/version.h
  CC      scripts/mod/empty.o
cc1: error: unrecognized command line option "-mno-shared-library-id"
/home/sonic/projects/buildroot/linux/linux-kernel/scripts/mod/empty.c:1:
error: -mshared-library-id= specified without -mid-shared-library
make[4]: *** [scripts/mod/empty.o] Error 1
make[3]: *** [scripts/mod] Error 2
make[2]: *** [scripts] Error 2


Regards,

Sonic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130417/2e8a91f1/attachment.html>

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

* [Buildroot] [PATCH v2 4/7] arch: toolchain: Introduce binary format FLAT types.
  2013-04-17  9:02             ` Sonic Zhang
@ 2013-04-23  5:57               ` Sonic Zhang
  0 siblings, 0 replies; 30+ messages in thread
From: Sonic Zhang @ 2013-04-23  5:57 UTC (permalink / raw)
  To: buildroot

Hi Peter and Thomas,

Any further suggestion on how can I push forward this patch?

Compiler parameter -mno-xxx is not an option for blackfin specific flag
id-shared-library=0.

Regards,

Sonic


On Wed, Apr 17, 2013 at 5:02 PM, Sonic Zhang <sonic.adi@gmail.com> wrote:

> Hi Thomas,
>
>
> On Tue, Apr 16, 2013 at 6:46 PM, Thomas Petazzoni <
> thomas.petazzoni at free-electrons.com> wrote:
>
>> Dear Sonic Zhang,
>>
>> On Tue, 16 Apr 2013 18:26:22 +0800, Sonic Zhang wrote:
>>
>> > > Not sure exactly if that's the right solution or not. Peter, you're
>> the
>> > > one who did the external toolchain wrapper originally. Could you
>> > > comment on this specific issue?
>> > >
>> > The LINUX_MAKE_FLAGS should not include the shared flat specific flags
>> > "-mno-id-shared-library ...". Your suggestion doesn't work when
>> > building Linux kernel. We need some ways to remove flags
>> > "-mno-id-shared-library ..." from the gcc wrapper for the shared flat
>> > binary format when building Linux kernel.
>>
>> Hm? If you pass -mno-id-shared-library after -mid-shared-library, it
>> will be just as if you hadn't passed the option at all. So if the
>> external toolchain wrapper passes -mid-shared-library, but then the
>> CFLAGS passed to the kernel override that by passing
>> -mno-id-shared-library, it will be just as if the external wrapper
>> hadn't passed -mid-shared-library.
>>
>>
> The blackfin GNU toolchain doesn't understand flag
> "-mno-shared-library-id", "-mno-shared-library-id=" and
> "-mno-shared-library-id=0". Flag "-mshared-library-id=0" set in wrapper
> can't be canceled by passing "-mno-shared-library-id" later in linux.mk.
>
>
> ifeq ($(BR2_bfin),y)
> LINUX_MAKE_FLAGS += KBUILD_CFLAGS="$(TARGET_CFLAGS) -mno-id-shared-library
> -mno-shared-library-id -mno-sep-data"
> endif
>
>
> PATH="/home/sonic/projects/buildroot/output/host/bin:/home/sonic/projects/buildroot/output/host/usr/bin:/home/sonic/projects/buildroot/output/host/usr/sbin/:/opt/arm/bin:/opt/uclinux/bfin-elf/bin/:/opt/uclinux/bfin-uclinux/bin/:/opt/uclinux/bfin-linux-uclibc/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
> PERLLIB="/home/sonic/projects/buildroot/output/host/usr/lib/perl"
> /usr/bin/make -j4
> O="/home/sonic/projects/buildroot/output/build/linux-custom"
> HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=blackfin
> INSTALL_MOD_PATH=/home/sonic/projects/buildroot/output/target
> CROSS_COMPILE="
> /home/sonic/projects/buildroot/output/host/usr/bin/bfin-uclinux-"
> DEPMOD=/home/sonic/projects/buildroot/output/host/usr/sbin/depmod
> KBUILD_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64  -pipe -Os  -D__NOMMU__ -D__uClinux__
> -mno-id-shared-library -mno-shared-library-id -mno-sep-data" -C
> "linux/linux-kernel"/ uImage
> make[1]: Entering directory
> `/home/sonic/projects/buildroot/linux/linux-kernel'
>   GEN     /home/sonic/projects/buildroot/output/build/linux-custom/Makefile
>   CHK     include/generated/uapi/linux/version.h
>   CC      scripts/mod/empty.o
> cc1: error: unrecognized command line option "-mno-shared-library-id"
> /home/sonic/projects/buildroot/linux/linux-kernel/scripts/mod/empty.c:1:
> error: -mshared-library-id= specified without -mid-shared-library
> make[4]: *** [scripts/mod/empty.o] Error 1
> make[3]: *** [scripts/mod] Error 2
> make[2]: *** [scripts] Error 2
>
>
> Regards,
>
> Sonic
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130423/d5499318/attachment-0001.html>

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

end of thread, other threads:[~2013-04-23  5:57 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Buildroot] [PATCH v2 6/7] arch: Introduce blackfin-specific Makefile Sonic Zhang
2013-04-07 21:41   ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox