Bug 51159 - build failure with --enable-build-with-cxx in "gcc-4.6.2/gcc/objc/objc-next-runtime-abi-02.c"
Summary: build failure with --enable-build-with-cxx in "gcc-4.6.2/gcc/objc/objc-next-r...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: objc++ (show other bugs)
Version: 4.6.2
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-16 13:54 UTC by sebastian.hegler
Modified: 2011-11-21 09:43 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Proposed patch. (268 bytes, patch)
2011-11-16 13:54 UTC, sebastian.hegler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sebastian.hegler 2011-11-16 13:54:53 UTC
Created attachment 25837 [details]
Proposed patch.

I am trying to build gcc-4.6.2 with the following flags:
./../gcc-4.6.2/configure --disable-nls --with-ppl=$GCC_BASE --with-cloog=$GCC_BASE --prefix=$GCC_BASE --with--mpfr=$GCC_BASE --with-gmp=$GCC_BASE --with-mpc=$GCC_BASE --with-libelf=$GCC_BASE --enable-lto --enable-gold --enable-bootstrap --enable-build-with-cxx

Everything necessary is prepared in $GCC_BASE.

Eventually, this happens:
.././../gcc-4.6.2/gcc/objc/objc-next-runtime-abi-02.c: In function ‘const char* newabi_append_ro(const char*)’:
.././../gcc-4.6.2/gcc/objc/objc-next-runtime-abi-02.c:1884:29: error: invalid conversion from ‘const char*’ to ‘char*’
make[2]: *** [objc/objc-next-runtime-abi-02.o] Error 1


C++ provides the following signatures for strchr:
const char * strchr ( const char * str, int character );
      char * strchr (       char * str, int character );

Neither of these matches, making the assignment in "dollar = strchr (name, '$');" fail. Please find the proposed patch attached (which might break compilation with C, I don't know C as good as C++).
Comment 1 Andrew Pinski 2011-11-16 21:18:20 UTC
Have you tried the trunk?  --enable-build-with-cxx is really only needed if your plugin is written in C++.
Comment 2 sebastian.hegler 2011-11-17 10:44:33 UTC
Fixed in trunk r173723, not fixed in gcc-4.6-branch. 

"--enable-build-with-cxx" is an officially supported build option, so it should work reliably in releases.
Comment 3 Andrew Pinski 2011-11-17 21:36:17 UTC
(In reply to comment #2)
> "--enable-build-with-cxx" is an officially supported build option, so it should
> work reliably in releases.

But this is not a regression so closing as fixed for 4.7.0.
Comment 4 Andrew Pinski 2011-11-17 21:37:12 UTC
(In reply to comment #2)
> "--enable-build-with-cxx" is an officially supported build option, so it should
> work reliably in releases.

But this is not a regression so closing as fixed for 4.7.0.
And it was not really a supported build option, it was an experimental option.
Comment 5 sebastian.hegler 2011-11-21 09:43:23 UTC
Any chance of seeing the fix backported to 4.6, though?