Skip to contentSkip to conversation

uclibc: no need for CONFIG_MIPS_ISA_xxx config options

PATCH In review André Draszik 2 participants 6 messages Jun 10, 2016 – Jun 21, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 uclibc: no need for CONFIG_MIPS_ISA_xxx config options

From: André Draszik <[email protected]>

The config option for the mips ISA have been completely removed from uclibc-ng. uclibc doesn't add gcc options based on those config options anymore. Hence we don't need to create them here either.

---
 meta/recipes-core/uclibc/uclibc.inc | 11 -----------
 1 file changed, 11 deletions(-)
meta/recipes-core/uclibc/uclibc.inc +0 -11
index 1d42284..71d4bdd 100644
@@ -88,16 +88,6 @@ python () {
     if "${OE_DEL}":
         d.setVar('configmangle_append', "${OE_DEL}" + "\n")
 
-    # by default uclibc uses mips1 ISA for o32 ABI
-    # if we use TARGET_CC_ARCH="-march=mips32" we end up 
-    # with conflicting march options to gcc. Here we
-    # ask for MIPS32 ISA to match the chosen arch
-    tune = d.getVar("DEFAULTTUNE", True)
-    if tune.startswith('mips32'):
-        import re
-        tune = re.sub('(el)*(-nf)*', '', tune)
-        d.setVar('configmangle_append',
-                 "/^### MIPS32_CHECK$/a\\\nCONFIG_MIPS_ISA_%s=y\n\n" % (tune.upper()))
     if "${OE_FEATURES}":
         d.setVar('configmangle_append',
                    "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
@@ -146,7 +136,6 @@ do_configure() {
         echo "### FPU" >>${S}/merged.config
         echo "### ABI" >>${S}/merged.config
         echo "### DISTRO FEATURES" >>${S}/merged.config
-        echo "### MIPS32_CHECK" >>${S}/merged.config
 
         # Mangle the resulting .config depending on OE variables
         sed -i -e '${configmangle}' ${S}/merged.config
Signature · 1 line
2.8.1
#1 lore raw

PATCH 2/2 uclibc: never build with SSP

From: André Draszik <[email protected]>

This doesn't work, as the initial gcc that is used for compiling uclibc doesn't have support for SSP yet (since that will only be available once uclibc has been compiled). Since during that same compilation step uclibc is trying to build its own utils those are failing to compile with SSP enabled as the initial gcc doesn't have access to the required libraries, yet.

We never used to set UCLIBC_BUILD_SSP in the past, this was only changed as part of the upgrade to uclibc-ng in commit 63bdadc (uclibc: Switch to using uclibc-ng), so here we now simply restore the previous behaviour.

Note that we still enable SSP support inside uclibc for everybody else to use, though.

---
 meta/recipes-core/uclibc/uclibc-config.inc | 1 -
 1 file changed, 1 deletion(-)
meta/recipes-core/uclibc/uclibc-config.inc +0 -1
index ed7b522..8b9e41c 100644
@@ -119,7 +119,6 @@ def features_to_uclibc_settings(d):
     uclibc_cfg('thumb-interwork', distro_features,'USE_BX', cnf, rem)
     uclibc_cfg('xattr',     distro_features, 'UCLIBC_HAS_XATTR', cnf, rem)
     uclibc_cfg('ssp',       distro_features, 'UCLIBC_HAS_SSP', cnf, rem)
-    uclibc_cfg('ssp',       distro_features, 'UCLIBC_BUILD_SSP', cnf, rem)
     uclibc_cfg('argp',       distro_features, 'UCLIBC_HAS_ARGP', cnf, rem)
     uclibc_cfg('libc-posix-clang-wchar',  distro_features,'UCLIBC_HAS_WCHAR', cnf, rem)
     return "\n".join(cnf), "\n".join(rem)
Signature · 1 line
2.8.1
#2 lore raw

Re: [PATCH 2/2] uclibc: never build with SSP

Quoted 9 lines · André Draszik

From: André Draszik <[email protected]>

This doesn't work, as the initial gcc that is used for compiling uclibc doesn't have support for SSP yet (since that will only be available once uclibc has been compiled). Since during that same compilation step uclibc is trying to build its own utils those are failing to compile with SSP enabled as the initial gcc doesn't have access to the required libraries, yet.

Please look at how we do this for glibc based systems. This patch is not something we need.

Quoted 34 lines

We never used to set UCLIBC_BUILD_SSP in the past, this was only changed as part of the upgrade to uclibc-ng in commit 63bdadc (uclibc: Switch to using uclibc-ng), so here we now simply restore the previous behaviour.

Note that we still enable SSP support inside uclibc for everybody else to use, though.

---
 meta/recipes-core/uclibc/uclibc-config.inc | 1 -
 1 file changed, 1 deletion(-)
meta/recipes-core/uclibc/uclibc-config.inc +0 -2
index ed7b522..8b9e41c 100644
@@ -119,7 +119,6 @@ def features_to_uclibc_settings(d):
     uclibc_cfg('thumb-interwork', distro_features,'USE_BX', cnf, rem)
     uclibc_cfg('xattr',     distro_features, 'UCLIBC_HAS_XATTR', cnf, rem)
     uclibc_cfg('ssp',       distro_features, 'UCLIBC_HAS_SSP', cnf, rem)
-    uclibc_cfg('ssp',       distro_features, 'UCLIBC_BUILD_SSP', cnf, rem)
     uclibc_cfg('argp',       distro_features, 'UCLIBC_HAS_ARGP', cnf, rem)
     uclibc_cfg('libc-posix-clang-wchar',  distro_features,'UCLIBC_HAS_WCHAR', cnf, rem)
     return "\n".join(cnf), "\n".join(rem)
--

2.8.1

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

#3 lore raw

Re: [PATCH 2/2] uclibc: never build with SSP

Hi Khem,

Quoted 11 lines · Khem Raj
Quoted 9 lines · André Draszik

From: André Draszik <[email protected]>

This doesn't work, as the initial gcc that is used for compiling uclibc doesn't have support for SSP yet (since that will only be available once uclibc has been compiled). Since during that same compilation step uclibc is trying to build its own utils those are failing to compile with SSP enabled as the initial gcc doesn't have access to the required libraries, yet.

Quoted 1 line

Please look at how we do this for glibc based systems.

Are you saying glibc is compiled *with* SSP enabled?

I can't seem to find anything relevant. The only thing I can find seems to result in glibc and (and glibc-initial) and all glibc executables (!) being compiled without stack protector. As you seem to have something in mind, can you please be more specific and give me a pointer?

Quoted 2 lines

This patch is
not something we need.

This patch fixes uclibc builds when SSP has been enabled by including security_flags.inc in distro.conf. Why is it not needed? Can you be more specific please?

Cheers,
Andre

#4 lore raw

Re: [PATCH 2/2] uclibc: never build with SSP

Quoted 2 lines · André Draszik

This patch fixes uclibc builds when SSP has been enabled by including security_flags.inc in distro.conf

Should read:

This patch fixes uclibc builds when SSP has been enabled by including security_flags.inc in distro.conf and adding "ssp" to DISTRO_FEATURES.

#5 lore raw

Re: [PATCH 2/2] uclibc: never build with SSP

In reply to André Draszik
Quoted 17 lines · André Draszik

Hi Khem,

Quoted 11 lines · Khem Raj
Quoted 9 lines · André Draszik

From: André Draszik <[email protected]>

This doesn't work, as the initial gcc that is used for compiling uclibc doesn't have support for SSP yet (since that will only be available once uclibc has been compiled). Since during that same compilation step uclibc is trying to build its own utils those are failing to compile with SSP enabled as the initial gcc doesn't have access to the required libraries, yet.

Quoted 3 lines
Quoted 1 line

Please look at how we do this for glibc based systems.

Are you saying glibc is compiled *with* SSP enabled?

We set the ssp variables manually (gcc_cv_libc_provides_ssp=yes), when building gcc initial. which should suffice for building core libraries. If uclibc build extra utils then lets spin that via a separate recipe something like uclibc-utils or some such which is built later than uclibc.

Quoted 17 lines

I can't seem to find anything relevant. The only thing I can find seems to result in glibc and (and glibc-initial) and all glibc executables (!) being compiled without stack protector. As you seem to have something in mind, can you please be more specific and give me a pointer?

Quoted 2 lines

This patch is
not something we need.

This patch fixes uclibc builds when SSP has been enabled by including security_flags.inc in distro.conf. Why is it not needed? Can you be more specific please?

Cheers,
Andre