Bug 2222 - option enable-target-optspace disables _GNU_SOURCE
Summary: option enable-target-optspace disables _GNU_SOURCE
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 2.95.2
: P3 normal
Target Milestone: 5.0
Assignee: DJ Delorie
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2001-03-08 02:36 UTC by Alexander Holler
Modified: 2021-08-26 12:58 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-07 16:52:11


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Holler 2001-03-08 02:36:00 UTC
Compiling gcc with --enable-target-optspace (e.g. for embedded systems) (config/mt-ospace) overwrites -D_GNU_SOURCE (config/mt-linux). So errors occuring during compile because of missing pthread support (first in iostream.cc).

Release:
2.95.2 19991024

Environment:
linux

How-To-Repeat:
compile gcc with --enable-target-optspace
Comment 1 Richard Henderson 2002-06-20 14:16:52 UTC
Responsible-Changed-From-To: unassigned->dj
Responsible-Changed-Why: Build machinery mis-feature.
Comment 2 Andrew Pinski 2003-10-01 04:10:13 UTC
Does anyone know if this still happens?
Comment 3 Andrew Pinski 2004-01-02 06:02:26 UTC
Still happens.
Comment 4 Ian Lance Taylor 2011-06-02 20:23:10 UTC
DJ, this PR is currently assigned to you for some reason.  Do you think you are likely to fix it?
Comment 5 DJ Delorie 2011-06-02 20:33:43 UTC
Given that I forgot I had it, probably "no"
Comment 6 Oliver Metz 2011-06-03 09:32:44 UTC
Thanks Ian for your help.

This bug is still valid for gcc-4.6.0.

When --enable-target-optspace is set config/mt-ospace is included and overwrites the configured CFLAGS_FOR_TARGET variable. 

config/mt-ospace:
# Build libraries optimizing for space, not speed.
 CFLAGS_FOR_TARGET = -g -Os
 CXXFLAGS_FOR_TARGET = -g -Os

So it's not possible to optimize the target libs for the target (e.g. -march=4kc -msoft-float).
Comment 7 Andrew Pinski 2021-08-24 08:37:40 UTC
Fixed for GCC 5 by r5-5081.

https://gcc.gnu.org/pipermail/gcc-patches/2014-November/405648.html