Re: fix for 48208 and 48260 on darwin
On Mar 30, 2011, at 5:41 AM, gcchelp.5.ad...@0sg.net wrote: > Tests that now fail, but worked before: > > g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C (test for warnings, line 7) > > Tests that now work, but didn't before: > > g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C (test for warnings, line 7) Yeah, someone thought it would be funny to have two test cases with the same exact name, and then to have one of them fail and the other one work, so, technically, what it said is true. I've now applied the patch for you. In the future, by sure to attach the diffs as a file, as Mail eats white spacing in odd ways which corrupts patches. Thanks. 2011-03-30 Christian Schüler PR/driver 48208 * config/c.opt (F): Added 'Driver' to -F option. PR/driver 48260 * config/darwin-driver.c (darwin_driver_init): Add '-arch' to handler function. * config/darwin.opt: Added '-arch' option. Index: c-family/c.opt === --- c-family/c.opt (revision 171691) +++ c-family/c.opt (working copy) @@ -201,7 +201,7 @@ C ObjC C++ ObjC++ Undocumented Var(flag_preprocess_only) F -C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) +Driver C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) -FAdd to the end of the main framework include path H Index: config/darwin.opt === --- config/darwin.opt (revision 171691) +++ config/darwin.opt (working copy) @@ -31,6 +31,9 @@ allowable_client Driver Separate Alias(Zallowable_client) +arch +Driver RejectNegative Separate + arch_errors_fatal Driver Alias(Zarch_errors_fatal) Index: config/darwin-driver.c === --- config/darwin-driver.c (revision 171691) +++ config/darwin-driver.c (working copy) @@ -161,6 +161,15 @@ continue; switch ((*decoded_options)[i].opt_index) { +#if DARWIN_X86 + case OPT_arch: + if (!strcmp ((*decoded_options)[i].arg, "i386")) + generate_option (OPT_m32, NULL, 1, CL_DRIVER, &(*decoded_options)[i]); + else if (!strcmp ((*decoded_options)[i].arg, "x86_64")) + generate_option (OPT_m64, NULL, 1, CL_DRIVER, &(*decoded_options)[i]); + break; +#endif + case OPT_filelist: case OPT_framework: ++*decoded_options_count;
Re: fix for 48208 and 48260 on darwin
Ok so I needed to install dejagnu from macports. The comparison of the test results turned out empty except one output that made no sense: -- Tests that now fail, but worked before: g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C (test for warnings, line 7) Tests that now work, but didn't before: g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C (test for warnings, line 7) --- There was also this: sed: 1: "/#if[ \t]*!defined(__cpl ...": command c expects \ followed by text sed: stdout: Broken pipe Missing header fix: complex.h There were fixinclude test FAILURES --- Otherwise the summary is this: === gcc Summary === # of expected passes62994 # of unexpected failures49 # of expected failures211 # of unsupported tests1606 === g++ Summary === # of expected passes25521 # of expected failures160 # of unsupported tests365 === libstdc++ Summary === # of expected passes6984 # of expected failures81 # of unsupported tests661 === libgomp Summary === # of expected passes1025 # of unsupported tests2 On 28.03.11 19:58, Mike Stump - mikest...@comcast.net wrote: On Mar 27, 2011, at 8:55 PM, Christian Schüler wrote: please review the following patch (and besides, bear with me as this is the first patch proposal from me). For gcc 4.5 and earlier it was possible to configure xcode via a modified xcplugin to use the newer gcc directly (yes, the -arch flag was ignored during link time, but since I had -m32/-m64 anyways, this didn't matter). With the new argument checking of version 4.6 during the linking stage this is no longer possible. The proposed patch makes gcc on darwin recognize the -arch flag to the extent necessary to reinstate the old functionality. Besides, it fixes the already existing support for the -F flag. Ok (when regression tested). Did you run the gcc regression testsuite on it? To install it, we'd need a testsuite run on it. Roughy, run the testsuite before your patch, save off the .sum file, run it after your patch, then run contrib/compare_tests before.sum after.sum and see if there is any output. You might need expect/tcl/dejagnu installed to do that. If you want to contribute longer term (larger patches), you'll want to get started on your paper work, if you've not done that already. And, welcome. Before you say, but... let me say, what took so long, 10 years is a long while? :-)
Re: fix for 48208 and 48260 on darwin
On Mar 27, 2011, at 8:55 PM, Christian Schüler wrote: > please review the following patch (and besides, bear with me as this is the > first patch proposal from me). For gcc 4.5 and earlier it was possible to > configure xcode via a modified xcplugin to use the newer gcc directly (yes, > the -arch flag was ignored during link time, but since I had -m32/-m64 > anyways, this didn't matter). With the new argument checking of version 4.6 > during the linking stage this is no longer possible. The proposed patch makes > gcc on darwin recognize the -arch flag to the extent necessary to reinstate > the old functionality. Besides, it fixes the already existing support for the > -F flag. Ok (when regression tested). Did you run the gcc regression testsuite on it? To install it, we'd need a testsuite run on it. Roughy, run the testsuite before your patch, save off the .sum file, run it after your patch, then run contrib/compare_tests before.sum after.sum and see if there is any output. You might need expect/tcl/dejagnu installed to do that. If you want to contribute longer term (larger patches), you'll want to get started on your paper work, if you've not done that already. And, welcome. Before you say, but... let me say, what took so long, 10 years is a long while? :-)
Re: fix for 48208 and 48260 on darwin
On Mon, 28 Mar 2011, Christian Schüler wrote: > PR 48208 > * config/c.opt: Added 'Driver' to -F option This part of the changes is OK with the ChangeLog entry fixed (it should go in c-family/ChangeLog): PR driver/48208 * c.opt (-F): Add Driver. -- Joseph S. Myers jos...@codesourcery.com
Re: fix for 48208 and 48260 on darwin
Hi Christian, On 28 Mar 2011, at 04:55, Christian Schüler wrote: F -C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) +Driver C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after \ %qs) -F Add to the end of the main framework include path This looks right (but I cannot approve it). +++ gcc-4.6.0-RC-20110321-patched/gcc/config/darwin-driver.c 2011-03-26 07:01:02.0 +0100 @@ -161,6 +161,13 @@ continue; switch ((*decoded_options)[i].opt_index) { +#if DARWIN_X86 + case OPT_arch: + if (!strcmp ((*decoded_options)[i].arg, "i386")) + generate_option (OPT_m32, NULL, 1, CL_DRIVER, &(*decoded_options) [i]); + else if (!strcmp ((*decoded_options)[i].arg, "x86_64")) + generate_option (OPT_m64, NULL, 1, CL_DRIVER, &(*decoded_options) [i]); + break; +#endif Hm - this doesn't quite cover the scenario - what about people using GCC on powerpc*-darwin9? (or people on x86-darwin10 targeting powerpc on darwin9)? Normally, the "arch" option is recognized (and swallowed) by the "Apple way" 'driverdriver.c' program which then emits the right driver lines for the arch (and deals with cross-compiler lines for ppc). driverdriver.c is available from the Apple Local GCC open source releases (e.g. http://opensource.apple.com/source/gcc/gcc-5646/driverdriver.c) - it's at the top of the source tree - it builds OK against gcc-4.5 headers - which is OK, since it's a stand-alone program that just manipulates command lines (doesn't compile against gcc-4.6 headers because of the changes in option handling) [I guess someone should cook up one for gcc/contrib that works with our new system]. One then builds the {ppc,x86}-apple-darwin* compilers, installs them and you have a working set that does the "Apple way" layer on top of GCC. This works (at least a few weeks ago) - since I managed to get pre- release 4.6 going within XCode - but needs a couple more small patches to deal with other options. --- -- ping me off list, if you would like to try this and I'll try and send more detailed instructions and a couple of additional patches that are "work in progress" ... -- however, I can neither approve nor reject your patches ;-) cheers Iain
fix for 48208 and 48260 on darwin
Hallo list, please review the following patch (and besides, bear with me as this is the first patch proposal from me). For gcc 4.5 and earlier it was possible to configure xcode via a modified xcplugin to use the newer gcc directly (yes, the -arch flag was ignored during link time, but since I had -m32/-m64 anyways, this didn't matter). With the new argument checking of version 4.6 during the linking stage this is no longer possible. The proposed patch makes gcc on darwin recognize the -arch flag to the extent necessary to reinstate the old functionality. Besides, it fixes the already existing support for the -F flag. Thanks, Christian 2011-03-28 Christian Schüler gmx.de> PR 48208 * config/c.opt: Added 'Driver' to -F option PR 48260 * config/darwin-driver.c: Add '-arch' to handler function * config/darwin.opt: Added '-arch' option diff -Naurw gcc-4.6.0-RC-20110321/gcc/c-family/c.opt \ gcc-4.6.0-RC-20110321-patched/gcc/c-family/c.opt --- gcc-4.6.0-RC-20110321/gcc/c-family/c.opt2011-02-17 22:34:10 +0100 +++ gcc-4.6.0-RC-20110321-patched/gcc/c-family/c.opt 2011-03-25 19:04:08 +0100 @@ -201,7 +201,7 @@ C ObjC C++ ObjC++ Undocumented Var(flag_preprocess_only) F -C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) +Driver C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after \ %qs) -FAdd to the end of the main framework include path H diff -Naurw gcc-4.6.0-RC-20110321/gcc/config/darwin-driver.c \ gcc-4.6.0-RC-20110321-patched/gcc/config/darwin-driver.c --- gcc-4.6.0-RC-20110321/gcc/config/darwin-driver.c2010-11-11 00:23:15 +0100 +++ gcc-4.6.0-RC-20110321-patched/gcc/config/darwin-driver.c2011-03-26 07:01:02.0 +0100 @@ -161,6 +161,13 @@ continue; switch ((*decoded_options)[i].opt_index) { +#if DARWIN_X86 + case OPT_arch: + if (!strcmp ((*decoded_options)[i].arg, "i386")) + generate_option (OPT_m32, NULL, 1, CL_DRIVER, &(*decoded_options)[i]); + else if (!strcmp ((*decoded_options)[i].arg, "x86_64")) + generate_option (OPT_m64, NULL, 1, CL_DRIVER, &(*decoded_options)[i]); + break; +#endif + case OPT_filelist: case OPT_framework: ++*decoded_options_count; diff -Naurw gcc-4.6.0-RC-20110321/gcc/config/darwin.opt \ gcc-4.6.0-RC-20110321-patched/gcc/config/darwin.opt --- gcc-4.6.0-RC-20110321/gcc/config/darwin.opt 2011-02-07 21:11:45 +0100 +++ gcc-4.6.0-RC-20110321-patched/gcc/config/darwin.opt 2011-03-25 19:04:08 +0100 @@ -31,6 +31,9 @@ allowable_client Driver Separate Alias(Zallowable_client) +arch +Driver RejectNegative Separate + arch_errors_fatal Driver Alias(Zarch_errors_fatal)