Skip to content

Commit e5d8c4c

Browse files
committed
Ensure Linux 32-bit builds in Docker produce 32-bit binaries
1 parent 28ffea0 commit e5d8c4c

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

java/crossbuild/docker-build-linux.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,22 @@ if hash scl 2>/dev/null; then
3737
fi
3838
fi
3939

40+
# Detect if 32-bit linux platform with 'linux32' command
41+
LINUX32=""
42+
if hash linux32 2>/dev/null; then
43+
LINUX32="linux32"
44+
fi
45+
4046
# Build with devtoolset if available, otherwise use system compiler
4147
# Add -Wno-error=restrict for GCC 12+ to avoid false positive warnings
4248
if [ -n "$DEVTOOLSET" ]; then
4349
echo "Using $DEVTOOLSET"
44-
scl enable $DEVTOOLSET "bash -c 'make clean-not-downloaded'"
45-
scl enable $DEVTOOLSET "bash -c 'PORTABLE=1 J=$J make -j$J rocksdbjavastatic'"
50+
$LINUX32 scl enable $DEVTOOLSET "bash -c 'make clean-not-downloaded'"
51+
$LINUX32 scl enable $DEVTOOLSET "bash -c 'PORTABLE=1 J=$J make -j$J rocksdbjavastatic'"
4652
else
4753
echo "No SCL devtoolset found, falling back to system compiler"
48-
make clean-not-downloaded
49-
PORTABLE=1 J=$J make -j$J rocksdbjavastatic
54+
$LINUX32 make clean-not-downloaded
55+
PORTABLE=1 J=$J $LINUX32 make -j$J rocksdbjavastatic
5056
fi
5157

5258
cp java/target/librocksdbjni-linux*.so java/target/rocksdbjni-*-linux*.jar java/target/rocksdbjni-*-linux*.jar.sha1 /rocksdb-java-target

0 commit comments

Comments
 (0)