On 5/2/2013 1:26 AM, Steve Bennett wrote:
On 02/05/2013, at 4:54 PM, Edward Berner wrote:

[...]

The cc-run.tcl file allows the configure script to run code snippets at 
configure time.  It looks like a lot of new code but it isn't really -- it is 
basically a lightly modified version of the cctest procedure from cc.tcl.

[...]
I haven't looked at the changes in question, but autosetup is explicitly 
designed
to not support run-time tests. The problem is that as soon as you cross 
compile, these
tests do not work. If at all possible, a compile-time test is preferred.
Perhaps as simple as always using this setting when targeting openbsd/sparc64.

I think I handled the cross compilation case sufficiently, but welcome other feedback. Specifically, I first test that "return 0;" runs okay and if it doesn't I assume we're cross compiling or something and assume that the bug is not present. This will miss detecting the bug if one is cross compiling targeting openbsd/sparc64 but I think that is an uncommon use case.

Currently my "cc-run" function is boolean: "ran okay" or "didn't run okay", and I explicitly try running "return 0;" before trying the code that exercises the bug. If you think it'd be cleaner, I could see including the "return 0;" test in "cc-run" making it a three-valued function: "can't run anything", "ran okay", or "didn't run okay", so folks wouldn't forget to check for the cross compilation case. In any case, I agree that it should be used sparingly but suspect that sometimes it is the only way to perform a test.

--
Edward Berner

_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to