Skip to contentSkip to conversation

gcc-configure-common.inc: drop --enable-target-optspace from configure

PATCH In review Andre McCurdy 2 participants 6 messages Feb 1, 2016 – Feb 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gcc-configure-common.inc: drop --enable-target-optspace from configure

Configuring gcc with --enable-target-optspace (which causes gcc to append "-g -Os" to the default CFLAGS_FOR_TARGET and so force libgcc etc target libraries to always be optimised for size) dates back to the very first commit in oe-core git in 2005 (for gcc 3.4.3).

Configuring gcc with --enable-target-optspace is not done widely elsewhere (it's not used for Ubuntu or Fedora host gcc, the Linaro binary toolchain or in Buildroot since early 2015). Sometime around gcc 4.5.x it caused problems for powerpc and so was disabled for that architecture:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810

This patch removes --enable-target-optspace completely (ie powerpc is no longer a special case) and allows optimisation of libgcc etc to be controlled directly by the flags present in TARGET_CFLAGS.

---
 meta/recipes-devtools/gcc/gcc-configure-common.inc | 8 --------
 meta/recipes-devtools/gcc/gcc-cross-initial.inc    | 1 -
 2 files changed, 9 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -8
index 85e69db..f4f76bd 100644
@@ -14,13 +14,6 @@ JAVA_sh3 ?= ""
 # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
 FORTRAN ?= ",f77"
 LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
-# disable --enable-target-optspace for powerpc SPE
-# at -Os libgcc.so.1 creates references into
-# hidden symbols in libgcc.a which linker complains
-# when linking shared libraries further in the build like (gnutls)
-
-SPECIAL_ARCH_LIST = "powerpc"
-OPTSPACE = '${@bb.utils.contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}", "", "--enable-target-optspace",d)}'
 
 EXTRA_OECONF_BASE ?= ""
 EXTRA_OECONF_PATHS ?= ""
@@ -42,7 +35,6 @@ EXTRA_OECONF = "\
     --enable-libstdcxx-pch \
     --program-prefix=${TARGET_PREFIX} \
     --without-local-prefix \
-    ${OPTSPACE} \
     ${EXTRA_OECONF_BASE} \
     ${EXTRA_OECONF_GCC_FLOAT} \
     ${EXTRA_OECONF_PATHS} \
meta/recipes-devtools/gcc/gcc-cross-initial.inc +0 -1
index 910f2ef..048b530 100644
@@ -22,7 +22,6 @@ EXTRA_OECONF = "\
     --disable-multilib \
     --disable-__cxa_atexit \
     --enable-languages=c \
-    ${OPTSPACE} \
     --program-prefix=${TARGET_PREFIX} \
     --with-sysroot=/not/exist \
     --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
Signature · 1 line
1.9.1
#1 lore raw

What is the size increase in gcc runtime when u do this

Quoted 73 lines · Andre McCurdy

Configuring gcc with --enable-target-optspace (which causes gcc to append "-g -Os" to the default CFLAGS_FOR_TARGET and so force libgcc etc target libraries to always be optimised for size) dates back to the very first commit in oe-core git in 2005 (for gcc 3.4.3).

Configuring gcc with --enable-target-optspace is not done widely elsewhere (it's not used for Ubuntu or Fedora host gcc, the Linaro binary toolchain or in Buildroot since early 2015). Sometime around gcc 4.5.x it caused problems for powerpc and so was disabled for that architecture:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810

This patch removes --enable-target-optspace completely (ie powerpc is no longer a special case) and allows optimisation of libgcc etc to be controlled directly by the flags present in TARGET_CFLAGS.

---
 meta/recipes-devtools/gcc/gcc-configure-common.inc | 8 --------
 meta/recipes-devtools/gcc/gcc-cross-initial.inc    | 1 -
 2 files changed, 9 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -7
index 85e69db..f4f76bd 100644
@@ -14,13 +14,6 @@ JAVA_sh3 ?= ""
 # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
 FORTRAN ?= ",f77"
 LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
-# disable --enable-target-optspace for powerpc SPE
-# at -Os libgcc.so.1 creates references into
-# hidden symbols in libgcc.a which linker complains
-# when linking shared libraries further in the build like (gnutls)
-
-SPECIAL_ARCH_LIST = "powerpc"
-OPTSPACE = '${@bb.utils.contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}",

"", "--enable-target-optspace",d)}'

EXTRA_OECONF_BASE ?= ""
EXTRA_OECONF_PATHS ?= ""

meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -1
@@ -42,7 +35,6 @@ EXTRA_OECONF = "\
     --enable-libstdcxx-pch \
     --program-prefix=${TARGET_PREFIX} \
     --without-local-prefix \
-    ${OPTSPACE} \
     ${EXTRA_OECONF_BASE} \
     ${EXTRA_OECONF_GCC_FLOAT} \
     ${EXTRA_OECONF_PATHS} \
meta/recipes-devtools/gcc/gcc-cross-initial.inc +0 -2
index 910f2ef..048b530 100644
@@ -22,7 +22,6 @@ EXTRA_OECONF = "\
     --disable-multilib \
     --disable-__cxa_atexit \
     --enable-languages=c \
-    ${OPTSPACE} \
     --program-prefix=${TARGET_PREFIX} \
     --with-sysroot=/not/exist \
     --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
Quoted 1 line · Khem Raj

What is the size increase in gcc runtime when u do this

No significant changes.

Binaries which link statically with libgcc all grow a little (somewhere between 10 and 50 bytes).

libgcc_s.so.1 itself grows by approx 1%:

   text       data        bss        dec        hex    filename
 114896        516         56     115468      1c30c    libgcc_s.so.1 (-Os)
 116148        516         56     116720      1c7f0    libgcc_s.so.1 (-O2)

libssp, libstdc++, libgomp and libatomic all ignore the --enable-target-optspace configure option, so are not affected.

(Results from an armv7ve build).

Quoted 74 lines · Andre McCurdy
Quoted 73 lines

Configuring gcc with --enable-target-optspace (which causes gcc to append "-g -Os" to the default CFLAGS_FOR_TARGET and so force libgcc etc target libraries to always be optimised for size) dates back to the very first commit in oe-core git in 2005 (for gcc 3.4.3).

Configuring gcc with --enable-target-optspace is not done widely elsewhere (it's not used for Ubuntu or Fedora host gcc, the Linaro binary toolchain or in Buildroot since early 2015). Sometime around gcc 4.5.x it caused problems for powerpc and so was disabled for that architecture:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810

This patch removes --enable-target-optspace completely (ie powerpc is no longer a special case) and allows optimisation of libgcc etc to be controlled directly by the flags present in TARGET_CFLAGS.

---
 meta/recipes-devtools/gcc/gcc-configure-common.inc | 8 --------
 meta/recipes-devtools/gcc/gcc-cross-initial.inc    | 1 -
 2 files changed, 9 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -7
index 85e69db..f4f76bd 100644
@@ -14,13 +14,6 @@ JAVA_sh3 ?= ""
 # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
 FORTRAN ?= ",f77"
 LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
-# disable --enable-target-optspace for powerpc SPE
-# at -Os libgcc.so.1 creates references into
-# hidden symbols in libgcc.a which linker complains
-# when linking shared libraries further in the build like (gnutls)
-
-SPECIAL_ARCH_LIST = "powerpc"
-OPTSPACE = '${@bb.utils.contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}",

"", "--enable-target-optspace",d)}'

EXTRA_OECONF_BASE ?= ""
EXTRA_OECONF_PATHS ?= ""

meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -1
@@ -42,7 +35,6 @@ EXTRA_OECONF = "\
     --enable-libstdcxx-pch \
     --program-prefix=${TARGET_PREFIX} \
     --without-local-prefix \
-    ${OPTSPACE} \
     ${EXTRA_OECONF_BASE} \
     ${EXTRA_OECONF_GCC_FLOAT} \
     ${EXTRA_OECONF_PATHS} \
meta/recipes-devtools/gcc/gcc-cross-initial.inc +0 -2
index 910f2ef..048b530 100644
@@ -22,7 +22,6 @@ EXTRA_OECONF = "\
     --disable-multilib \
     --disable-__cxa_atexit \
     --enable-languages=c \
-    ${OPTSPACE} \
     --program-prefix=${TARGET_PREFIX} \
     --with-sysroot=/not/exist \
     --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 8 lines · Andre McCurdy
Quoted 1 line · Khem Raj

What is the size increase in gcc runtime when u do this

No significant changes.

Quoted 8 lines

Binaries which link statically with libgcc all grow a little (somewhere between 10 and 50 bytes).

libgcc_s.so.1 itself grows by approx 1%:

  text       data        bss        dec        hex    filename
114896        516         56     115468      1c30c    libgcc_s.so.1 (-Os)
116148        516         56     116720      1c7f0    libgcc_s.so.1 (-O2)

Thanks, I am ok with this change. Can you also report a qemuppc build with this change and make sure it boots ?

Quoted 80 lines

libssp, libstdc++, libgomp and libatomic all ignore the --enable-target-optspace configure option, so are not affected.

(Results from an armv7ve build).

Quoted 74 lines · Andre McCurdy
Quoted 73 lines

Configuring gcc with --enable-target-optspace (which causes gcc to append "-g -Os" to the default CFLAGS_FOR_TARGET and so force libgcc etc target libraries to always be optimised for size) dates back to the very first commit in oe-core git in 2005 (for gcc 3.4.3).

Configuring gcc with --enable-target-optspace is not done widely elsewhere (it's not used for Ubuntu or Fedora host gcc, the Linaro binary toolchain or in Buildroot since early 2015). Sometime around gcc 4.5.x it caused problems for powerpc and so was disabled for that architecture:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810

This patch removes --enable-target-optspace completely (ie powerpc is no longer a special case) and allows optimisation of libgcc etc to be controlled directly by the flags present in TARGET_CFLAGS.

---
meta/recipes-devtools/gcc/gcc-configure-common.inc | 8 --------
meta/recipes-devtools/gcc/gcc-cross-initial.inc | 1 -

2 files changed, 9 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -0
index 85e69db..f4f76bd 100644
@@ -14,13 +14,6 @@ JAVA_sh3 ?= ""
 # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'

FORTRAN ?= ",f77"
LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"

meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -7
-# disable --enable-target-optspace for powerpc SPE
-# at -Os libgcc.so.1 creates references into
-# hidden symbols in libgcc.a which linker complains
-# when linking shared libraries further in the build like (gnutls)
-
-SPECIAL_ARCH_LIST = "powerpc"
-OPTSPACE = '${@bb.utils.contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}",

"", "--enable-target-optspace",d)}'

EXTRA_OECONF_BASE ?= ""
EXTRA_OECONF_PATHS ?= ""

meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -1
@@ -42,7 +35,6 @@ EXTRA_OECONF = "\
    --enable-libstdcxx-pch \
    --program-prefix=${TARGET_PREFIX} \
    --without-local-prefix \
-    ${OPTSPACE} \
    ${EXTRA_OECONF_BASE} \
    ${EXTRA_OECONF_GCC_FLOAT} \
    ${EXTRA_OECONF_PATHS} \
meta/recipes-devtools/gcc/gcc-cross-initial.inc +0 -2
index 910f2ef..048b530 100644
@@ -22,7 +22,6 @@ EXTRA_OECONF = "\
    --disable-multilib \
    --disable-__cxa_atexit \
    --enable-languages=c \
-    ${OPTSPACE} \
    --program-prefix=${TARGET_PREFIX} \
    --with-sysroot=/not/exist \
    --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw
Quoted 11 lines · Khem Raj
Quoted 11 lines · Andre McCurdy
Quoted 1 line · Khem Raj

What is the size increase in gcc runtime when u do this

No significant changes.

Binaries which link statically with libgcc all grow a little (somewhere between 10 and 50 bytes).

Quoted 8 lines
Quoted 5 lines

libgcc_s.so.1 itself grows by approx 1%:

  text       data        bss        dec        hex    filename
114896        516         56     115468      1c30c    libgcc_s.so.1 (-Os)
116148        516         56     116720      1c7f0    libgcc_s.so.1 (-O2)

Thanks, I am ok with this change. Can you also report a qemuppc build with this change and make sure it boots ?

No issues seen booting qemuppc core-image-minimal built from today's poky master branch.

Quoted 81 lines
Quoted 80 lines

libssp, libstdc++, libgomp and libatomic all ignore the --enable-target-optspace configure option, so are not affected.

(Results from an armv7ve build).

Quoted 74 lines · Andre McCurdy
Quoted 73 lines

Configuring gcc with --enable-target-optspace (which causes gcc to append "-g -Os" to the default CFLAGS_FOR_TARGET and so force libgcc etc target libraries to always be optimised for size) dates back to the very first commit in oe-core git in 2005 (for gcc 3.4.3).

Configuring gcc with --enable-target-optspace is not done widely elsewhere (it's not used for Ubuntu or Fedora host gcc, the Linaro binary toolchain or in Buildroot since early 2015). Sometime around gcc 4.5.x it caused problems for powerpc and so was disabled for that architecture:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810

This patch removes --enable-target-optspace completely (ie powerpc is no longer a special case) and allows optimisation of libgcc etc to be controlled directly by the flags present in TARGET_CFLAGS.

---
meta/recipes-devtools/gcc/gcc-configure-common.inc | 8 --------
meta/recipes-devtools/gcc/gcc-cross-initial.inc | 1 -

2 files changed, 9 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -0
index 85e69db..f4f76bd 100644
@@ -14,13 +14,6 @@ JAVA_sh3 ?= ""
 # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'

FORTRAN ?= ",f77"
LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"

meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -7
-# disable --enable-target-optspace for powerpc SPE
-# at -Os libgcc.so.1 creates references into
-# hidden symbols in libgcc.a which linker complains
-# when linking shared libraries further in the build like (gnutls)
-
-SPECIAL_ARCH_LIST = "powerpc"
-OPTSPACE = '${@bb.utils.contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}",

"", "--enable-target-optspace",d)}'

EXTRA_OECONF_BASE ?= ""
EXTRA_OECONF_PATHS ?= ""

meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -1
@@ -42,7 +35,6 @@ EXTRA_OECONF = "\
    --enable-libstdcxx-pch \
    --program-prefix=${TARGET_PREFIX} \
    --without-local-prefix \
-    ${OPTSPACE} \
    ${EXTRA_OECONF_BASE} \
    ${EXTRA_OECONF_GCC_FLOAT} \
    ${EXTRA_OECONF_PATHS} \
meta/recipes-devtools/gcc/gcc-cross-initial.inc +0 -2
index 910f2ef..048b530 100644
@@ -22,7 +22,6 @@ EXTRA_OECONF = "\
    --disable-multilib \
    --disable-__cxa_atexit \
    --enable-languages=c \
-    ${OPTSPACE} \
    --program-prefix=${TARGET_PREFIX} \
    --with-sysroot=/not/exist \
    --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#5 lore raw
Quoted 21 lines · Andre McCurdy
Quoted 17 lines · Khem Raj
Quoted 16 lines · Andre McCurdy
Quoted 1 line · Khem Raj

What is the size increase in gcc runtime when u do this

No significant changes.

Binaries which link statically with libgcc all grow a little (somewhere between 10 and 50 bytes).

libgcc_s.so.1 itself grows by approx 1%:

text data bss dec hex filename

114896        516         56     115468      1c30c    libgcc_s.so.1 (-Os)
116148        516         56     116720      1c7f0    libgcc_s.so.1 (-O2)
Quoted 5 lines
Quoted 2 lines

Thanks, I am ok with this change. Can you also report a qemuppc build with this change and make sure it boots ?

No issues seen booting qemuppc core-image-minimal built from today's poky master branch.

great thanks for following up