Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 173998 - gcc-config - Solaris wants #include <alloca.h>
Summary: gcc-config - Solaris wants #include <alloca.h>
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: Sparc Solaris
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-10 08:22 UTC by Fabian Groffen
Modified: 2007-04-11 08:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
wrapper non-alloca patch (wrapper.patch,3.00 KB, patch)
2007-04-10 12:47 UTC, Fabian Groffen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2007-04-10 08:22:28 UTC
compiling gcc-config on Solaris gives a warning of an implicitly defined function `alloca' conflicts with built-in function.  This is simply resolved by including <alloc.h>.  I haven't found any repercussions of this include on Linux, Darwin and AIX.

(inlining patch because it's trivial)

Index: files/wrapper-1.4.7.c
===================================================================
--- files/wrapper-1.4.7.c       (revision 5251)
+++ files/wrapper-1.4.7.c       (working copy)
@@ -20,6 +20,7 @@
 #include <string.h>
 #include <stdarg.h>
 #include <errno.h>
+#include <alloca.h>
 
 #define GCC_CONFIG "/usr/bin/gcc-config"
 #define ENVD_BASE  "/etc/env.d/05gcc"
Comment 1 SpanKY gentoo-dev 2007-04-10 11:24:25 UTC
i dont like the sound of that at all ... why not just remove the usage of alloca()

after all, this seems pretty frivolous:
int main(int argc, char *argv[]) {
    struct wrapper_data *data;
    data = alloca(sizeof(*data));

might as well just write it:
int main(int argc, char *argv[]) {
    struct wrapper_data data;
Comment 2 Fabian Groffen gentoo-dev 2007-04-10 11:55:36 UTC
Your rewrite makes sense to me.  It's up to you.
Comment 3 Fabian Groffen gentoo-dev 2007-04-10 12:12:32 UTC
I just patched ldwrapper (which is based on (gcc) wrapper), do you want me to come up with a patch which punts the alloca usage?
Comment 4 SpanKY gentoo-dev 2007-04-10 12:30:45 UTC
feel free to post ... the worst that could happen is that i ignore it and write it myself ;)
Comment 5 Fabian Groffen gentoo-dev 2007-04-10 12:47:52 UTC
Created attachment 115893 [details, diff]
wrapper non-alloca patch

Ok, I'll take that challenge :)
Comment 6 SpanKY gentoo-dev 2007-04-11 08:51:07 UTC
that's pretty much how i would have written it, thanks

added to gcc-config-1.3.16