On Tue, Nov 12, 2013 at 08:52:44AM +0000, Remi Mommsen wrote: > Hi Jack, > > On Nov 11, 2013, at 10:34 PM, Jack Howarth <howa...@bromo.med.uc.edu> wrote: > > > Remi, > > I've committed a workaround for the moment for the problem on 10.9... > > > >> if [[ $(sw_vers -productVersion | cut -d. -f1-2) > 10.8 ]]; then > >> perl -pi -e 's|CDEBUGFLAGS = -O0 |CDEBUGFLAGS = -O0 -D_FORTIFY_SOURCE=0 > >> |g' %b/packlib/kuip/programs/kuipc/Makefile > >> fi > > > > My tests show that the following... > > > > 1) the kuipc binary compiled on 10.8 works fine on 10.9 for the failing > > step of... > > > > kuipc kuipcdf.cdf kuipcdf.c > > > > 2) building the kuipc on 10.9 with either -mmacosx-version-min=10.8 or the > > -isysroot on the 10.8 SDK > > doesn't eliminate the failure on 10.9 when executing 'kuipc kuipcdf.cdf > > kuipcdf.c' > > > > 3) compiling kuipcc.c and kkern.c in > > /sw/src/fink.build/cernlib2006-2006b-21/2006/src/packlib/kuip/programs/kuipc > > with -D_FORTIFY_SOURCE=0 appended to CDEBUGFLAGS is sufficient to suppress > > the problem on 10.9. > > > > I plan on opening a radar with stand alone test cases derived from the 10.8 > > and failing 10.9 builds. I'll > > pinpoint which of the two files are at fault, ...I suspect kupipc.c, at the > > point. The hack for the moment > > impacts both files as I would have had to add a patch otherwise to allow > > each file to have its own > > compile flags and that seemed like overkill. > > Jack > > > > Thanks a lot for looking into this and providing a fix. I didn't know about > FORTIFY_SOURCE and would never have figured that out for myself. > > Cheers, > Remi
Remi, I heard back on radr://15442262 and the problem in src/packlib/kuip/programs/kuipc/kuipcc.c is in fact that strcpy with overlapping source and destination is illegal in 10.9's FORTIFY_SOURCE implementation. The reason a small test case like... #include <iostream> int main( int argc, char** argv) { char* p = &argv[1][0]; std::cout << p << std::endl; strcpy( p, p+1); std::cout << p << std::endl; return -1; } doesn't trigger it is that Apple hasn't implemented FORTIFY_SOURCE for C++ yet. So as some point we should try to rewrite the offending code in kuipcc.c to not use overlapping strings in strcpy. I guess the test of any change would be to verify that it produces the same output for... kuipc kuipcdf.cdf kuipcdf.c Jack ------------------------------------------------------------------------------ DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk _______________________________________________ Fink-devel mailing list Fink-devel@lists.sourceforge.net List archive: http://news.gmane.org/gmane.os.apple.fink.devel Subscription management: https://lists.sourceforge.net/lists/listinfo/fink-devel