https://sourceware.org/bugzilla/show_bug.cgi?id=28975

            Bug ID: 28975
           Summary: run-large-elf-file.sh fails in 32-bit cross-compile on
                    64-bit machine
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: general
          Assignee: unassigned at sourceware dot org
          Reporter: eric.boehm at broadcom dot com
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

run-large-elf-file.sh should not run if it is a 32-bit cross-compile on a
64-bit machine.

The shell script checks

long_bit=$(getconf LONG_BIT)

which will return 64 even if it is a 32-bit compile

Here's a patch which is a bit of a hack. There are probably more appropriate
ways to fix this.

This affects versions 0.181-0.186

--- elfutils-0.181/tests/run-large-elf-file.sh.orig     2020-09-08
04:45:06.000000000 -0700
+++ elfutils-0.181/tests/run-large-elf-file.sh  2022-03-17 12:23:53.967607000
-0700
@@ -21,3 +21,8 @@
 # ELF files.
-long_bit=$(getconf LONG_BIT)
+if [[ $CC =~ "-m32" ]]
+then
+    long_bit=32
+else
+    long_bit=$(getconf LONG_BIT)
+fi
 echo "long_bit: $long_bit"

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to