Discussion:
[PATCH 1/5] [rt-tests] Use CFLAGS specified by ptxdist platformconfig
Remy Bohmer
2012-03-12 21:25:00 UTC
Permalink
The platformconfig can specify some valuable global flags for each
package in the configuration to build, for example:
* CPU optimisations (-march= and friends)
* multilib toolchain selection between x86_64 and ia32 such as used for
the Sourcery Codebench compiler toolchains as specified here:
https://sourcery.mentor.com/sgpp/lite/ia32/portal/doc12648/getting-started.pdf

Signed-off-by: Remy Bohmer <linux-SYUVB/VFmdasTnJN9+***@public.gmane.org>
---
patches/rt-tests-0.73/add-extra-cflags.patch | 23 +++++++++++++++++++++++
patches/rt-tests-0.73/series | 1 +
rules/rt-tests.make | 1 +
3 files changed, 25 insertions(+), 0 deletions(-)
create mode 100644 patches/rt-tests-0.73/add-extra-cflags.patch

diff --git a/patches/rt-tests-0.73/add-extra-cflags.patch b/patches/rt-tests-0.73/add-extra-cflags.patch
new file mode 100644
index 0000000..6809377
--- /dev/null
+++ b/patches/rt-tests-0.73/add-extra-cflags.patch
@@ -0,0 +1,23 @@
+CFLAGS are specified in environment as well
+
+If the environment already has specified CFLAGS we shall
+not overwrite them
+
+Signed-off-by: Remy Bohmer <linux-SYUVB/VFmdasTnJN9+***@public.gmane.org>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: rt-tests-0.73/Makefile
+===================================================================
+--- rt-tests-0.73.orig/Makefile
++++ rt-tests-0.73/Makefile
+@@ -14,7 +14,7 @@ bindir ?= $(prefix)/bin
+ mandir ?= $(prefix)/share/man
+ srcdir ?= $(prefix)/src
+
+-CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include
++CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include $(CXXFLAGS)
+
+ PYLIB := $(shell python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()')
+
diff --git a/patches/rt-tests-0.73/series b/patches/rt-tests-0.73/series
index 74fbce0..caf1a74 100644
--- a/patches/rt-tests-0.73/series
+++ b/patches/rt-tests-0.73/series
@@ -1 +1,2 @@
fix_3_0_issue.diff
+add-extra-cflags.patch
diff --git a/rules/rt-tests.make b/rules/rt-tests.make
index 3bc6568..1880beb 100644
--- a/rules/rt-tests.make
+++ b/rules/rt-tests.make
@@ -34,6 +34,7 @@ RT_TESTS_DIR := $(BUILDDIR)/$(RT_TESTS)

RT_TESTS_CONF_TOOL := NO
RT_TESTS_MAKE_OPT := $(CROSS_ENV_CC) prefix=/usr
+RT_TESTS_MAKE_ENV := $(CROSS_ENV_FLAGS)
RT_TESTS_INSTALL_OPT := $(RT_TESTS_MAKE_OPT) install

# ----------------------------------------------------------------------------
--
1.7.5.4
Remy Bohmer
2012-03-12 21:25:01 UTC
Permalink
For Sourcery Codebench toolchains the 'gcc -print-file-name' only returns
the proper sysroot directory when the proper architecture flags are
provided via '-m64 -march=' flags. These flags are provided via the
ptxdist platformconfig PTXCONF_TARGET_EXTRA_CFLAGS setting.
These flags therefore also need to be passed to GCC here.

Signed-off-by: Remy Bohmer <linux-SYUVB/VFmdasTnJN9+***@public.gmane.org>
---
scripts/install_copy_toolchain.sh | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/install_copy_toolchain.sh b/scripts/install_copy_toolchain.sh
index 8a67698..48d65d7 100755
--- a/scripts/install_copy_toolchain.sh
+++ b/scripts/install_copy_toolchain.sh
@@ -50,12 +50,13 @@ ptxd_abs2rel() {
# out: $lib_path
#
ptxd_get_lib_path() {
- local lib lib_dir lib_path
+ local lib lib_dir lib_path extra_cflags

lib="${1}"
+ extra_cflags=$(source ${PTXDIST_PLATFORMCONFIG} && echo "${PTXCONF_TARGET_EXTRA_CFLAGS}")

# ask the compiler for the lib
- lib_path="$(${CC} -print-file-name=${lib})"
+ lib_path="$(${CC} ${extra_cflags} -print-file-name=${lib})"
if test "${lib_path}" = "${lib}"; then
echo "install_copy_toolchain_lib: ${lib} not found" >&2
return 1
@@ -77,9 +78,10 @@ ptxd_get_lib_path() {
#
ptxd_get_dl() {
local dl
+ extra_cflags=$(source ${PTXDIST_PLATFORMCONFIG} && echo "${PTXCONF_TARGET_EXTRA_CFLAGS}")

dl="$(echo 'int main(void){return 0;}' | \
- ${CC} -x c -o /dev/null -v - 2>&1 | \
+ ${CC} ${extra_cflags} -x c -o /dev/null -v - 2>&1 | \
sed -n -e 's/.* -dynamic-linker \([^ ]*\).*/\1/p')"

echo "${dl##*/}"
--
1.7.5.4
Michael Olbrich
2012-03-13 09:56:23 UTC
Permalink
Post by Remy Bohmer
For Sourcery Codebench toolchains the 'gcc -print-file-name' only returns
the proper sysroot directory when the proper architecture flags are
provided via '-m64 -march=' flags. These flags are provided via the
ptxdist platformconfig PTXCONF_TARGET_EXTRA_CFLAGS setting.
These flags therefore also need to be passed to GCC here.
---
scripts/install_copy_toolchain.sh | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/scripts/install_copy_toolchain.sh b/scripts/install_copy_toolchain.sh
index 8a67698..48d65d7 100755
--- a/scripts/install_copy_toolchain.sh
+++ b/scripts/install_copy_toolchain.sh
@@ -50,12 +50,13 @@ ptxd_abs2rel() {
# out: $lib_path
#
ptxd_get_lib_path() {
- local lib lib_dir lib_path
+ local lib lib_dir lib_path extra_cflags
lib="${1}"
+ extra_cflags=$(source ${PTXDIST_PLATFORMCONFIG} && echo "${PTXCONF_TARGET_EXTRA_CFLAGS}")
I think ptxd_get_ptxconf should work here. And I think you should use
PTXCONF_TARGET_EXTRA_CFLAGS and PTXCONF_TARGET_EXTRA_CPPFLAGS.
Post by Remy Bohmer
# ask the compiler for the lib
- lib_path="$(${CC} -print-file-name=${lib})"
+ lib_path="$(${CC} ${extra_cflags} -print-file-name=${lib})"
if test "${lib_path}" = "${lib}"; then
echo "install_copy_toolchain_lib: ${lib} not found" >&2
return 1
@@ -77,9 +78,10 @@ ptxd_get_lib_path() {
#
ptxd_get_dl() {
local dl
+ extra_cflags=$(source ${PTXDIST_PLATFORMCONFIG} && echo "${PTXCONF_TARGET_EXTRA_CFLAGS}")
dito.

Michael
Post by Remy Bohmer
dl="$(echo 'int main(void){return 0;}' | \
- ${CC} -x c -o /dev/null -v - 2>&1 | \
+ ${CC} ${extra_cflags} -x c -o /dev/null -v - 2>&1 | \
sed -n -e 's/.* -dynamic-linker \([^ ]*\).*/\1/p')"
echo "${dl##*/}"
--
1.7.5.4
--
ptxdist mailing list
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Remy Bohmer
2012-03-13 10:23:07 UTC
Permalink
Hi,
Post by Michael Olbrich
     lib="${1}"
+    extra_cflags=$(source ${PTXDIST_PLATFORMCONFIG} && echo "${PTXCONF_TARGET_EXTRA_CFLAGS}")
I think ptxd_get_ptxconf should work here. And I think you should use
PTXCONF_TARGET_EXTRA_CFLAGS and PTXCONF_TARGET_EXTRA_CPPFLAGS.
I did not know that, I will look into that.
Post by Michael Olbrich
     # ask the compiler for the lib
-    lib_path="$(${CC} -print-file-name=${lib})"
+    lib_path="$(${CC} ${extra_cflags} -print-file-name=${lib})"
     if test "${lib_path}" = "${lib}"; then
      echo "install_copy_toolchain_lib: ${lib} not found" >&2
      return 1
@@ -77,9 +78,10 @@ ptxd_get_lib_path() {
 #
 ptxd_get_dl() {
     local dl
+    extra_cflags=$(source ${PTXDIST_PLATFORMCONFIG} && echo "${PTXCONF_TARGET_EXTRA_CFLAGS}")
dito.
OK.

Thanks.

Kind regards,

Remy
--
ptxdist mailing list
ptxdist-bIcnvbaLZ9MEGnE8C9+***@public.gmane.org
Remy Bohmer
2012-03-12 21:25:02 UTC
Permalink
Busybox make is not properly called in case:
* compiler name tuple does not match target tuple (as used in multilib
compilers, for example: i686-pc-linux-gnu-gcc can compile for
x86_64-unknown-linux-gnu targets. To solve this the 'SUBARCH' need to be
set)
* CONFIG_EXTRA_CFLAGS need to e set to select the proper sysroot to
compile against in busybox
* LDFLAGS to link against the proper sysroot.

Signed-off-by: Remy Bohmer <linux-SYUVB/VFmdasTnJN9+***@public.gmane.org>
---
rules/busybox.make | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/rules/busybox.make b/rules/busybox.make
index 536aa80..42cb81c 100644
--- a/rules/busybox.make
+++ b/rules/busybox.make
@@ -49,9 +49,12 @@ $(STATEDIR)/busybox.prepare:

BUSYBOX_MAKE_OPT := \
ARCH=$(PTXCONF_ARCH_STRING) \
+ SUBARCH=$(PTXCONF_ARCH_STRING) \
CROSS_COMPILE=$(COMPILER_PREFIX) \
CONFIG_EXTRA_CFLAGS="$(CROSS_CFLAGS)" \
HOSTCC=$(HOSTCC) \
+ CONFIG_EXTRA_CFLAGS="$(PTXCONF_TARGET_EXTRA_CFLAGS)" \
+ LDFLAGS="$(PTXCONF_TARGET_EXTRA_LDFLAGS)" \
SKIP_STRIP=y

ifdef PTXCONF_BUSYBOX_RFKILL
--
1.7.5.4
Michael Olbrich
2012-03-13 09:59:03 UTC
Permalink
Post by Remy Bohmer
* compiler name tuple does not match target tuple (as used in multilib
compilers, for example: i686-pc-linux-gnu-gcc can compile for
x86_64-unknown-linux-gnu targets. To solve this the 'SUBARCH' need to be
set)
* CONFIG_EXTRA_CFLAGS need to e set to select the proper sysroot to
compile against in busybox
* LDFLAGS to link against the proper sysroot.
---
rules/busybox.make | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/rules/busybox.make b/rules/busybox.make
index 536aa80..42cb81c 100644
--- a/rules/busybox.make
+++ b/rules/busybox.make
BUSYBOX_MAKE_OPT := \
ARCH=$(PTXCONF_ARCH_STRING) \
+ SUBARCH=$(PTXCONF_ARCH_STRING) \
CROSS_COMPILE=$(COMPILER_PREFIX) \
CONFIG_EXTRA_CFLAGS="$(CROSS_CFLAGS)" \
HOSTCC=$(HOSTCC) \
+ CONFIG_EXTRA_CFLAGS="$(PTXCONF_TARGET_EXTRA_CFLAGS)" \
+ LDFLAGS="$(PTXCONF_TARGET_EXTRA_LDFLAGS)" \
CONFIG_EXTRA_CFLAGS="$(CROSS_CPPFLAGS) $(CROSS_CFLAGS)" \
$(CROSS_ENV_LDFLAGS) \

Michael
Post by Remy Bohmer
SKIP_STRIP=y
ifdef PTXCONF_BUSYBOX_RFKILL
--
1.7.5.4
--
ptxdist mailing list
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Remy Bohmer
2012-03-13 10:26:46 UTC
Permalink
Hi,
 BUSYBOX_MAKE_OPT := \
      ARCH=$(PTXCONF_ARCH_STRING) \
+     SUBARCH=$(PTXCONF_ARCH_STRING) \
      CROSS_COMPILE=$(COMPILER_PREFIX) \
      CONFIG_EXTRA_CFLAGS="$(CROSS_CFLAGS)" \
      HOSTCC=$(HOSTCC) \
+     CONFIG_EXTRA_CFLAGS="$(PTXCONF_TARGET_EXTRA_CFLAGS)" \
+     LDFLAGS="$(PTXCONF_TARGET_EXTRA_LDFLAGS)" \
       CONFIG_EXTRA_CFLAGS="$(CROSS_CPPFLAGS) $(CROSS_CFLAGS)" \
       $(CROSS_ENV_LDFLAGS) \
IIRC I tried this and that the build started failing if I added all flags.
Will look into it again.

Thanks.

Kind regards,

Remy
--
ptxdist mailing list
ptxdist-bIcnvbaLZ9MEGnE8C9+***@public.gmane.org
Remy Bohmer
2012-03-13 12:46:26 UTC
Permalink
Hi,
Post by Remy Bohmer
* compiler name tuple does not match target tuple (as used in multilib
  compilers, for example: i686-pc-linux-gnu-gcc can compile for
  x86_64-unknown-linux-gnu targets. To solve this the 'SUBARCH' need to be
  set)
* CONFIG_EXTRA_CFLAGS need to e set to select the proper sysroot to
  compile against in busybox
* LDFLAGS to link against the proper sysroot.
---
 rules/busybox.make |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/rules/busybox.make b/rules/busybox.make
index 536aa80..42cb81c 100644
--- a/rules/busybox.make
+++ b/rules/busybox.make
 BUSYBOX_MAKE_OPT := \
      ARCH=$(PTXCONF_ARCH_STRING) \
+     SUBARCH=$(PTXCONF_ARCH_STRING) \
      CROSS_COMPILE=$(COMPILER_PREFIX) \
      CONFIG_EXTRA_CFLAGS="$(CROSS_CFLAGS)" \
      HOSTCC=$(HOSTCC) \
+     CONFIG_EXTRA_CFLAGS="$(PTXCONF_TARGET_EXTRA_CFLAGS)" \
+     LDFLAGS="$(PTXCONF_TARGET_EXTRA_LDFLAGS)" \
       CONFIG_EXTRA_CFLAGS="$(CROSS_CPPFLAGS) $(CROSS_CFLAGS)" \
       $(CROSS_ENV_LDFLAGS) \
This results in:
-----------------------
target: busybox.prepare
-----------------------

make: invalid option -- '6'
make: invalid option -- '4'
make: invalid option -- '/'
make: invalid option -- '/'
Usage: make [options] [target] ...
Options:
etc.

It seems I have to stick with the bare minimal options I can set
here... Or any other ideas?

Kind regards,

Remy
--
ptxdist mailing list
ptxdist-bIcnvbaLZ9MEGnE8C9+***@public.gmane.org
Michael Olbrich
2012-03-13 13:06:16 UTC
Permalink
Post by Remy Bohmer
Hi,
Post by Remy Bohmer
* compiler name tuple does not match target tuple (as used in multilib
  compilers, for example: i686-pc-linux-gnu-gcc can compile for
  x86_64-unknown-linux-gnu targets. To solve this the 'SUBARCH' need to be
  set)
* CONFIG_EXTRA_CFLAGS need to e set to select the proper sysroot to
  compile against in busybox
* LDFLAGS to link against the proper sysroot.
---
 rules/busybox.make |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/rules/busybox.make b/rules/busybox.make
index 536aa80..42cb81c 100644
--- a/rules/busybox.make
+++ b/rules/busybox.make
 BUSYBOX_MAKE_OPT := \
      ARCH=$(PTXCONF_ARCH_STRING) \
+     SUBARCH=$(PTXCONF_ARCH_STRING) \
      CROSS_COMPILE=$(COMPILER_PREFIX) \
      CONFIG_EXTRA_CFLAGS="$(CROSS_CFLAGS)" \
      HOSTCC=$(HOSTCC) \
+     CONFIG_EXTRA_CFLAGS="$(PTXCONF_TARGET_EXTRA_CFLAGS)" \
+     LDFLAGS="$(PTXCONF_TARGET_EXTRA_LDFLAGS)" \
       CONFIG_EXTRA_CFLAGS="$(CROSS_CPPFLAGS) $(CROSS_CFLAGS)" \
       $(CROSS_ENV_LDFLAGS) \
-----------------------
target: busybox.prepare
-----------------------
make: invalid option -- '6'
make: invalid option -- '4'
make: invalid option -- '/'
make: invalid option -- '/'
Usage: make [options] [target] ...
etc.
It seems I have to stick with the bare minimal options I can set
here... Or any other ideas?
Don't set any flags in BUSYBOX_MAKE_OPT. From what I can tell, the current
busybox Makefile uses CFLAGS, CPPFLAGS and LDFLAGS from the environment.
Try something like this (untested):

BUSYBOX_MAKE_OPT := \
ARCH=$(PTXCONF_ARCH_STRING) \
SUBARCH=$(PTXCONF_ARCH_STRING) \
CROSS_COMPILE=$(COMPILER_PREFIX) \
HOSTCC=$(HOSTCC)

BUSYBOX_MAKE_ENV := \
$(CROSS_ENV) \
CFLAGS="$(CROSS_CFLAGS) -I$(KERNEL_HEADERS_INCLUDE_DIR)"
SKIP_STRIP=y

BUSYBOX_INSTAL_ENV := \
$(BUSYBOX_MAKE_ENV)


and remove the PTXCONF_BUSYBOX_RFKILL stuff. The extra "-I" unconditionally
does not hurt.

Michael
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
ptxdist mailing list
ptxdist-bIcnvbaLZ9MEGnE8C9+***@public.gmane.org
Remy Bohmer
2012-03-13 21:31:52 UTC
Permalink
Hi,
Post by Michael Olbrich
Post by Remy Bohmer
It seems I have to stick with the bare minimal options I can set
here... Or any other ideas?
Don't set any flags in BUSYBOX_MAKE_OPT. From what I can tell, the current
busybox Makefile uses CFLAGS, CPPFLAGS and LDFLAGS from the environment.
BUSYBOX_MAKE_OPT := \
       ARCH=$(PTXCONF_ARCH_STRING) \
       SUBARCH=$(PTXCONF_ARCH_STRING) \
       CROSS_COMPILE=$(COMPILER_PREFIX) \
       HOSTCC=$(HOSTCC)
BUSYBOX_MAKE_ENV := \
       $(CROSS_ENV) \
       CFLAGS="$(CROSS_CFLAGS) -I$(KERNEL_HEADERS_INCLUDE_DIR)"
       SKIP_STRIP=y
BUSYBOX_INSTAL_ENV := \
       $(BUSYBOX_MAKE_ENV)
and remove the PTXCONF_BUSYBOX_RFKILL stuff. The extra "-I" unconditionally
does not hurt.
This seems to work properly. Thanks.
Will repost a new series in a minute.

Kind regards,

Remy
--
ptxdist mailing list
ptxdist-bIcnvbaLZ9MEGnE8C9+***@public.gmane.org
Remy Bohmer
2012-03-12 21:25:03 UTC
Permalink
It is assumed by the makefiles that all dynamic linkers must be put in
/lib. This is however not true. Especially on multilib configurations this
information cannot be guessed. By looking in the sysroot of the compiler
toolchain the right paths can be found. Default the scripts already look
there, so remove the unneeded options.

Signed-off-by: Remy Bohmer <linux-SYUVB/VFmdasTnJN9+***@public.gmane.org>
---
rules/glibc.make | 2 +-
rules/post/install.make | 9 +++------
rules/uclibc.make | 2 +-
3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/rules/glibc.make b/rules/glibc.make
index c4e6724..3ddf249 100644
--- a/rules/glibc.make
+++ b/rules/glibc.make
@@ -36,7 +36,7 @@ $(STATEDIR)/glibc.targetinstall:
@$(call install_fixup, glibc,DESCRIPTION,missing)

ifdef PTXCONF_GLIBC_LD
- @$(call install_copy_toolchain_dl, glibc, /lib)
+ @$(call install_copy_toolchain_dl, glibc)
endif

ifdef PTXCONF_GLIBC_C
diff --git a/rules/post/install.make b/rules/post/install.make
index 4ad7f87..190ec28 100644
--- a/rules/post/install.make
+++ b/rules/post/install.make
@@ -317,17 +317,14 @@ install_copy_toolchain_lib = \
# install_copy_toolchain_dl
#
# $1: xpkg label
-# $2: destination
-# $3: strip (y|n) default is to strip
+# $2: strip (y|n) default is to strip
#
install_copy_toolchain_dl = \
XPKG=$(subst _,-,$(strip $(1))); \
- DST="$(strip $2)"; \
- STRIP="$(strip $3)"; \
- test "$${DST}" != "" && DST="-d $${DST}"; \
+ STRIP="$(strip $2)"; \
$(call install_check, install_copy_toolchain_dl); \
${CROSS_ENV_CC} $(CROSS_ENV_STRIP) PKGDIR="$(PKGDIR)" \
- $(SCRIPTSDIR)/install_copy_toolchain.sh -p "$${XPKG}" -l LINKER $${DST} -s "$${STRIP}"
+ $(SCRIPTSDIR)/install_copy_toolchain.sh -p "$${XPKG}" -l LINKER -s "$${STRIP}"

#
# install_copy_toolchain_other
diff --git a/rules/uclibc.make b/rules/uclibc.make
index 22583fd..c6cc86f 100644
--- a/rules/uclibc.make
+++ b/rules/uclibc.make
@@ -30,7 +30,7 @@ $(STATEDIR)/uclibc.targetinstall:
@$(call install_fixup, uclibc,DESCRIPTION,missing)

ifdef PTXCONF_UCLIBC
- @$(call install_copy_toolchain_dl, uclibc, /lib)
+ @$(call install_copy_toolchain_dl, uclibc)
endif

ifdef PTXCONF_UCLIBC_C
--
1.7.5.4
Michael Olbrich
2012-03-13 10:07:47 UTC
Permalink
Post by Remy Bohmer
It is assumed by the makefiles that all dynamic linkers must be put in
/lib. This is however not true. Especially on multilib configurations this
information cannot be guessed. By looking in the sysroot of the compiler
toolchain the right paths can be found. Default the scripts already look
there, so remove the unneeded options.
No obvious issues but I need to do some more testing, to make sure it
doesn't break any other toolchains.

Michael
Post by Remy Bohmer
---
rules/glibc.make | 2 +-
rules/post/install.make | 9 +++------
rules/uclibc.make | 2 +-
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/rules/glibc.make b/rules/glibc.make
index c4e6724..3ddf249 100644
--- a/rules/glibc.make
+++ b/rules/glibc.make
@$(call install_fixup, glibc,DESCRIPTION,missing)
ifdef PTXCONF_GLIBC_LD
endif
ifdef PTXCONF_GLIBC_C
diff --git a/rules/post/install.make b/rules/post/install.make
index 4ad7f87..190ec28 100644
--- a/rules/post/install.make
+++ b/rules/post/install.make
@@ -317,17 +317,14 @@ install_copy_toolchain_lib = \
# install_copy_toolchain_dl
#
# $1: xpkg label
-# $2: destination
-# $3: strip (y|n) default is to strip
+# $2: strip (y|n) default is to strip
#
install_copy_toolchain_dl = \
XPKG=$(subst _,-,$(strip $(1))); \
- DST="$(strip $2)"; \
- STRIP="$(strip $3)"; \
- test "$${DST}" != "" && DST="-d $${DST}"; \
+ STRIP="$(strip $2)"; \
$(call install_check, install_copy_toolchain_dl); \
${CROSS_ENV_CC} $(CROSS_ENV_STRIP) PKGDIR="$(PKGDIR)" \
- $(SCRIPTSDIR)/install_copy_toolchain.sh -p "$${XPKG}" -l LINKER $${DST} -s "$${STRIP}"
+ $(SCRIPTSDIR)/install_copy_toolchain.sh -p "$${XPKG}" -l LINKER -s "$${STRIP}"
#
# install_copy_toolchain_other
diff --git a/rules/uclibc.make b/rules/uclibc.make
index 22583fd..c6cc86f 100644
--- a/rules/uclibc.make
+++ b/rules/uclibc.make
@$(call install_fixup, uclibc,DESCRIPTION,missing)
ifdef PTXCONF_UCLIBC
endif
ifdef PTXCONF_UCLIBC_C
--
1.7.5.4
--
ptxdist mailing list
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Remy Bohmer
2012-03-13 10:28:13 UTC
Permalink
Hi,
Post by Michael Olbrich
Post by Remy Bohmer
It is assumed by the makefiles that all dynamic linkers must be put in
/lib. This is however not true. Especially on multilib configurations this
information cannot be guessed. By looking in the sysroot of the compiler
toolchain the right paths can be found. Default the scripts already look
there, so remove the unneeded options.
No obvious issues but I need to do some more testing, to make sure it
doesn't break any other toolchains.
OK. Thanks.

Kind regards,

Remy
Remy Bohmer
2012-03-13 10:34:52 UTC
Permalink
Hi,

FYI: With these 5 patches (and a few unfinished architecture.in
patches I have here locally) I at least get the glibc and the dynamic
linkers installed in the right place and all binaries we used to be
compiled with the right flags.
Furthermore, I noticed that the extra flags are not passed properly to
all packages, so I expect to find more issues with multilib on X86.
So, since we need the multilib/x86_64 support I expect that in time
more patches will likely be posted to get this supported in ptxdist.

Kind regards,

Remy
Michael Olbrich
2012-03-13 10:58:12 UTC
Permalink
Post by Remy Bohmer
FYI: With these 5 patches (and a few unfinished architecture.in
patches I have here locally) I at least get the glibc and the dynamic
linkers installed in the right place and all binaries we used to be
compiled with the right flags.
Furthermore, I noticed that the extra flags are not passed properly to
all packages, so I expect to find more issues with multilib on X86.
So, since we need the multilib/x86_64 support I expect that in time
more patches will likely be posted to get this supported in ptxdist.
Great. This has been a known issue for some time, but I don't have the
time to go through all the packages and fix it.

Michael
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Remy Bohmer
2012-03-12 21:25:04 UTC
Permalink
This link is always being generated and it is assumed that it must
always point to /lib/libdl.so.2.
But this script is not needed and points to the wrong location when a
multilib toolchain is being used where the dynamic linker must be in
/lib64

Signed-off-by: Remy Bohmer <linux-SYUVB/VFmdasTnJN9+***@public.gmane.org>
---
rules/glibc.make | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/rules/glibc.make b/rules/glibc.make
index 3ddf249..2de7a13 100644
--- a/rules/glibc.make
+++ b/rules/glibc.make
@@ -57,7 +57,6 @@ endif

ifdef PTXCONF_GLIBC_DL
@$(call install_copy_toolchain_lib, glibc, libdl.so.2)
- @$(call install_link, glibc, ../../lib/libdl.so.2, /usr/lib/libdl.so)
endif

ifdef PTXCONF_GLIBC_CRYPT
--
1.7.5.4
Michael Olbrich
2012-03-13 09:53:24 UTC
Permalink
Post by Remy Bohmer
The platformconfig can specify some valuable global flags for each
* CPU optimisations (-march= and friends)
* multilib toolchain selection between x86_64 and ia32 such as used for
https://sourcery.mentor.com/sgpp/lite/ia32/portal/doc12648/getting-started.pdf
---
patches/rt-tests-0.73/add-extra-cflags.patch | 23 +++++++++++++++++++++++
patches/rt-tests-0.73/series | 1 +
rules/rt-tests.make | 1 +
3 files changed, 25 insertions(+), 0 deletions(-)
create mode 100644 patches/rt-tests-0.73/add-extra-cflags.patch
diff --git a/patches/rt-tests-0.73/add-extra-cflags.patch b/patches/rt-tests-0.73/add-extra-cflags.patch
new file mode 100644
index 0000000..6809377
--- /dev/null
+++ b/patches/rt-tests-0.73/add-extra-cflags.patch
@@ -0,0 +1,23 @@
+CFLAGS are specified in environment as well
+
+If the environment already has specified CFLAGS we shall
+not overwrite them
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: rt-tests-0.73/Makefile
+===================================================================
+--- rt-tests-0.73.orig/Makefile
++++ rt-tests-0.73/Makefile
+ mandir ?= $(prefix)/share/man
+ srcdir ?= $(prefix)/src
+
+-CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include
++CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include $(CXXFLAGS)
This should be:
CFLAGS = $(CPPFLAGS) -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include $(CFLAGS)

CFLAGS is for C CXXFLAGS for C++ and CPPFLAGS in theory for the
preprocessor and therefore often used to pass flags for both.
And note the order.

And you should probably set:

LIBS = $(LDFLAGS) -lrt -lpthread

The flags should come first here.

Michael
Post by Remy Bohmer
+
+ PYLIB := $(shell python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()')
+
diff --git a/patches/rt-tests-0.73/series b/patches/rt-tests-0.73/series
index 74fbce0..caf1a74 100644
--- a/patches/rt-tests-0.73/series
+++ b/patches/rt-tests-0.73/series
@@ -1 +1,2 @@
fix_3_0_issue.diff
+add-extra-cflags.patch
diff --git a/rules/rt-tests.make b/rules/rt-tests.make
index 3bc6568..1880beb 100644
--- a/rules/rt-tests.make
+++ b/rules/rt-tests.make
@@ -34,6 +34,7 @@ RT_TESTS_DIR := $(BUILDDIR)/$(RT_TESTS)
RT_TESTS_CONF_TOOL := NO
RT_TESTS_MAKE_OPT := $(CROSS_ENV_CC) prefix=/usr
+RT_TESTS_MAKE_ENV := $(CROSS_ENV_FLAGS)
RT_TESTS_INSTALL_OPT := $(RT_TESTS_MAKE_OPT) install
# ----------------------------------------------------------------------------
--
1.7.5.4
--
ptxdist mailing list
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Remy Bohmer
2012-03-13 10:21:12 UTC
Permalink
Hi,
Post by Michael Olbrich
Post by Remy Bohmer
+-CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include
++CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include $(CXXFLAGS)
CFLAGS = $(CPPFLAGS) -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include $(CFLAGS)
CFLAGS is for C CXXFLAGS for C++ and CPPFLAGS in theory for the
preprocessor and therefore often used to pass flags for both.
And note the order.
Hmm, I knew that, not sure why I used CXXFLAGS...
Will fix it.
Post by Michael Olbrich
LIBS = $(LDFLAGS) -lrt -lpthread
The flags should come first here.
Will check that.

Thanks.

Kind regards,

Remy
Loading...