<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/84547>84547</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
18.1.0 (on linux): cross building for 32 bit on 64 bit host fails
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
balducci
</td>
</tr>
</table>
<pre>
hi
cross building for 32 bit on 64 bit linux host stops with:
```
/usr/bin/clang++ -m32 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/balducci/tmp/install-us-d/llvm-18.1.0.d/llvm-18.1.0/build.d/tools/bolt/lib/Core -I/home/balducci/tmp/install-us-d/llvm-18.1.0.d/llvm-18.1.0/bolt/lib/Core -I/home/balducci/tmp/install-us-d/llvm-18.1.0.d/llvm-18.1.0/build.d/include -I/home/balducci/tmp/install-us-d/llvm-18.1.0.d/llvm-18.1.0/llvm/include -I/home/balducci/tmp/install-us-d/llvm-18.1.0.d/llvm-18.1.0/bolt/include -I/home/balducci/tmp/install-us-d/llvm-18.1.0.d/llvm-18.1.0/build.d/tools/bolt/include -fPIC -fno-semantic-interposition -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fPIC -fno-exceptions -funwind-tables -MD -MT tools/bolt/lib/Core/CMakeFiles/LLVMBOLTCore.dir/BinaryFunction.cpp.o -MF tools/bolt/lib/Core/CMakeFiles/LLVMBOLTCore.dir/BinaryFunction.cpp.o.d -o tools/bolt/lib/Core/CMakeFiles/LLVMBOLTCore.dir/BinaryFunction.cpp.o -c /home/balducci/tmp/install-us-d/llvm-18.1.0.d/llvm-18.1.0/bolt/lib/Core/BinaryFunction.cpp
/home/balducci/tmp/install-us-d/llvm-18.1.0.d/llvm-18.1.0/bolt/lib/Core/BinaryFunction.cpp:190:7: error: static assertion failed due to requirement 'sizeof(const char *) >= sizeof(llvm::bolt::DebugLineTableRowRef)': Cannot fit instruction debug line information into SMLoc's pointer
190 | sizeof(decltype(SMLoc().getPointer())) >= sizeof(DebugLineTableRowRef),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/balducci/tmp/install-us-d/llvm-18.1.0.d/llvm-18.1.0/bolt/lib/Core/BinaryFunction.cpp:190:46: note: expression evaluates to '4 >= 8'
190 | sizeof(decltype(SMLoc().getPointer())) >= sizeof(DebugLineTableRowRef),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
Building for the native 64 bit host completes successfully.
I have been cross building for 32 bit with versions <=17.0.6 since
ever without any problem.
This is my configuration for cross building (unchanged from last
successful run with 17.0.6):
```
-DCMAKE_BUILD_TYPE=
-DCMAKE_INSTALL_PREFIX=/opt/stow.d/versions/llvm-18.1.0/usr
-DLLVM_ENABLE_FFI=ON
-DFFI_INCLUDE_DIR=/usr/include
-DFFI_STATIC_LIBRARIES=""
-DLLVM_BUILD_32_BITS=ON
-DLLVM_TARGET_ARCH=x86
-DLLVM_DEFAULT_TARGET_TRIPLE=i386-pc-linux-gnu
-DLLVM_HOST_TRIPLE=i386-pc-linux-gnu
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=i386-pc-linux-gnu
-DCMAKE_ASM_FLAGS=-m32
-DCMAKE_VERBOSE_MAKEFILE=ON
-DLLVM_ENABLE_PROJECTS=""
-DLLVM_BUILD_LLVM_DYLIB=ON
-DLLVM_INSTALL_UTILS=ON
-DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;BPF;"
-DLLVM_ENABLE_RTTI=ON
-DLLVM_INCLUDE_BENCHMARKS=OFF
-DLLDB_PYTHON_EXE_RELATIVE_PATH=/usr/python3/bin/python
```
I am building with:
```
##> clang --version
clang version 17.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
Do I need any new cmake option?
thanks in advance for any help
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEWN1zm7oS_2uUF408Njj-ePADNtByD449NmnaJ0aGBXQrJI4k8nEe7t9-R8Kpk7bp7Z1pz8kwxNKufvuh1WoXqjWrBcAKXa_RdXhFe9NItTpRXvZFwa5OsnxaNQyNQzQOhnehpNb41DNeMlHjSirse_jEDJYCz6buF2eif8SN1AZrIzuNH5hpkB-8xEGz8fkZhl7ca4W8-MQE8uKCU1Ejb428Ncak9T1MwjxO0ijfxfExyvJ1kh2RH86mlvDu5jY_7m4Pm8iO0uDwLnK8l7n8mIWbfLO7OWbBTZZvg81hd7wQ4t1hG3w7nSbb5DKbIC9uZAtWybODkBebtkNezIQ2lHPSa1IiL-b8viWTxWgyGo--GtvV1nlu3kjJtZ2R3Fg2dkJevJEKfqW034n9xRImCt6XvxLbjn4L8NkhvwH4rX39IqraJxtMKiGJhpYKwwrChAHVSc0MkwJjTO5AKamQH5bUADGshRdzvah7qkooCb2njNMT48w8EQEPmNxRzi3ro1EUkzshSS96DSXpqKItGFCY3D0oZoBoo5ioNSZ3BdWG_NlTu7JlWjNRk4oBLwkTzDDK2V-gNCYdlE7fAZhLUbuXRRiO6XJBCtl21BCngDWQYXLH2o6zghlSUc5No2RfN3aRvAcFJdEPzBQNKaGiPTcDuJDwWEBniHnqwE0Jcs-U6SknpZHWihI4GCDfoei-rkEbYvEVs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