-
Notifications
You must be signed in to change notification settings - Fork 577
[PATCH] Configure: Probe intsize with a compile-only test #14654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From @ntyniForwarding this report by Helmut Grohne from <https://bugs.debian.org/775940>: A major issue with cross building perl is that it tries to run host arch The patch is for 5.20.1 but it applies to current bleadperl with some Checking to see how big your integers are... If somebody could please add Helmut Grohne <helmut@subdivi.de> to the Many thanks for your work on Perl, |
From @ntyniintsize_cross.diffDescription: do not run host arch code for determining sizeof(int)
Author: Helmut Grohne <[email protected]>
Last-Update: 2015-01-21
--- perl-5.20.1.orig/Configure
+++ perl-5.20.1/Configure
@@ -5755,6 +5755,67 @@ case "$intsize" in
#ifdef I_STDLIB
#include <stdlib.h>
#endif
+int main() {
+ static int test[1 - 2 * (sizeof(int) < 0)];
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ :
+ else
+ echo "Your integers are negatively sized."
+ exit 1
+ fi
+ intsize_lo=0
+ intsize_hi=1
+ while :; do
+ $cat >try.c <<EOCP
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main() {
+ static int test[1 - 2 * (sizeof(int) >= $intsize_hi)];
+ return 0;
+}
+EOCP
+ set try
+ eval $compile_ok && break
+ intsize_lo=$intsize_hi
+ intsize_hi=`expr $intsize_lo "*" 2`
+ done
+ while $test $intsize_lo -lt `expr $intsize_hi - 1`; do
+ intsize_mid=`expr $intsize_lo + $intsize_hi`
+ intsize_mid=`expr $intsize_mid / 2`
+ $cat >try.c <<EOCP
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main() {
+ static int test[1 - 2 * (sizeof(int) >= $intsize_mid)];
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ intsize_hi=$intsize_mid
+ else
+ intsize_lo=$intsize_mid
+ fi
+ done
+ intsize=$intsize_lo
+ echo "Your integers are $intsize bytes long."
+
+ $cat >try.c <<EOCP
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
int main()
{
printf("intsize=%d;\n", (int)sizeof(int));
@@ -5766,7 +5827,6 @@ EOCP
set try
if eval $compile_ok && $run ./try > /dev/null; then
eval `$run ./try`
- echo "Your integers are $intsize bytes long."
echo "Your long integers are $longsize bytes long."
echo "Your short integers are $shortsize bytes long."
else
@@ -5777,10 +5837,6 @@ Help! I can't compile and run the intsiz
you really ought to fix it. Still, I'll try anyway.)
!
EOM
- dflt=4
- rp="What is the size of an integer (in bytes)?"
- . ./myread
- intsize="$ans"
dflt=$intsize
rp="What is the size of a long integer (in bytes)?"
. ./myread
|
From @TuxI'd like to discuss this once 5.22 has been released. One of the reasons is that smoke-me branches are not covered by the "weird" OS's that this approach would affect, whereas core-smokes do. I'll contact the maintainer of upriver meta/dist to acquire his opinion. |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Tue May 05 01:27:47 2015, hmbrand wrote:
See: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=125096#txn-1347825 which seems to belong to this ticket. |
From @jkeenanOn Tue May 05 01:27:47 2015, hmbrand wrote:
Which occurred today!
[Tux] How should we proceed? Thank you very much. -- |
From @TuxThe answer from the author of dist/meta: --8<--- In particular, the current intsize.U unit uses "static asserts" Even IEEE float endianness is now determined without running a program. The rationale for moving out of run-tests is that it prevents So the answer is yes, but this will take way more time than I currently can free: it involves matching every single unit that we (at perl5) use against the current checkout of meta/dist' keeping in mind that we might have diverged from the original path just for perl. The bus factor for this refactor is 1. I have done some one-to-one explanations of the process in the past, but it never lead to more people working on this code. |
From @jmdhOn Tue Jun 02 08:08:24 2015, hmbrand wrote:
Hello, Thanks for this explanation which is understandable if unfortunate. I wonder if anything might have changed here since your last update? We're revisiting patching Configure directly in Debian again, as it would (eventually) make cross-building easier, but this is indeed makework if the real fix is tractable. Thanks, |
Migrated from rt.perl.org#124326 (status was 'open')
Searchable as RT124326$
The text was updated successfully, but these errors were encountered: