<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57733>57733</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            libunwind does not build on 32-bit x86 anymore: error: dlfo_eh_dbase is not supported for D WARF-based unwinding
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libunwind,
            regression
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mgorny
      </td>
    </tr>
</table>

<pre>
    When attempting to build libunwind as part of runtimes for 32-bit multilib on x86, I get the following error:

```
FAILED: libunwind/src/CMakeFiles/unwind_shared_objects.dir/libunwind.cpp.o 
/usr/lib/ccache/bin/i686-pc-linux-gnu-clang++ --target=i686-pc-linux-gnu -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LIBUNWIND_LINK_DL_LIB -D_LIBUNWIND_LINK_PTHREAD_LIB -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/include  -march=znver2 -O2 -pipe -frecord-gcc-switches -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fPIC -Werror=return-type -W -Wall -Wchar-subscripts -Wconversion -Wmismatched-tags -Wmissing-braces -Wnewline-eof -Wno-unused-function -Wshadow -Wshorten-64-to-32 -Wsign-compare -Wsign-conversion -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter -Wunused-variable -Wwrite-strings -Wundef -Wno-suggest-override -Wno-error -pedantic -funwind-tables -nostdinc++ -fno-rtti -std=c++11  -fstrict-aliasing -fno-exceptions -fno-rtti -MD -MT libunwind/src/CMakeFiles/unwind_shared_objects.dir/libunwind.cpp.o -MF libunwind/src/CMakeFiles/unwind_shared_objects.dir/libunwind.cpp.o.d -o libunwind/src/CMakeFiles/unwind_shared_objects.dir/libunwind.cpp.o -c /tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/libunwind.cpp
In file included from /tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/libunwind.cpp:30:
In file included from /tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/AddressSpace.hpp:23:
In file included from /tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/EHHeaderParser.hpp:17:
In file included from /tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/DwarfParser.hpp:22:
/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/Registers.hpp:1549:54: warning: unused parameter 'regNum' [-Wunused-parameter]
inline bool Registers_ppc64::validVectorRegister(int regNum) const {
                                                     ^
/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/Registers.hpp:2871:5: warning: '__mips_isa_rev' is not defined, evaluates to 0 [-Wundef]
#if __mips_isa_rev != 6
    ^
/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/Registers.hpp:3195:5: warning: '__mips_isa_rev' is not defined, evaluates to 0 [-Wundef]
#if __mips_isa_rev != 6
    ^
In file included from /tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/libunwind.cpp:30:
/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/AddressSpace.hpp:590:2: error: dlfo_eh_dbase is not supported for DWARF-based unwinding
#error dlfo_eh_dbase is not supported for DWARF-based unwinding
 ^
In file included from /tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/libunwind.cpp:31:
In file included from /tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/UnwindCursor.hpp:44:
/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/DwarfInstructions.hpp:323:29: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'pint_t' (aka 'unsigned int') [-Wshorten-64-to-32]
          r2 = addressSpace.get64(sp + PPC64_ELFV1_R2_OFFSET);
             ~ ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/UnwindCursor.hpp:1003:37: note: in instantiation of member function 'libunwind::DwarfInstructions<libunwind::LocalAddressSpace, libunwind::Registers_x86>::stepWithDwarf' requested here
    return DwarfInstructions<A, R>::stepWithDwarf(_addressSpace,
                                    ^
/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/UnwindCursor.hpp:2820:20: note: in instantiation of member function 'libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86>::stepWithDwarfFDE' requested here
    result = this->stepWithDwarfFDE();
                   ^
/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/UnwindCursor.hpp:919:23: note: in instantiation of member function 'libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86>::step' requested here
                      UnwindCursor(unw_context_t *context, A &as);
                      ^
/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/libunwind.cpp:85:7: note: in instantiation of member function 'libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86>::UnwindCursor' requested here
      UnwindCursor<LocalAddressSpace, REGISTER_KIND>(
      ^
In file included from /tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/libunwind.cpp:31:
In file included from /tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/UnwindCursor.hpp:44:
/tmp/portage/sys-libs/llvm-libunwind-16.0.0.9999/work/libunwind/src/DwarfInstructions.hpp:326:29: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'pint_t' (aka 'unsigned int') [-Wshorten-64-to-32]
          r2 = addressSpace.get64(sp + PPC64_ELFV2_R2_OFFSET);
             ~ ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings and 1 error generated.
```

Full build log: [sys-libs:llvm-libunwind-16.0.0.9999:20220914-064512.log](https://github.com/llvm/llvm-project/files/9563495/sys-libs.llvm-libunwind-16.0.0.9999.20220914-064512.log)

It seems to have been broken by df9a23e2feda18f0308b6d4dbd591ebe6b605aa4 (CC @vogelsgesang). The prior commit builds successfully and passes all tests.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztWVlz4kgS_jX4paIIJCEBDzxgjmlifHRg9_hRUVKVRG1LKk1VCdvz6ydTB2Cb7u3Z9tEbuyB01JXHl5mViSLFH6d3W1EQZq3ISyuLlFhFokpmnGQyqop7WXDCDCmZtkQlRFeFlbkwJFGaeC6NpCV5lVkJo4kqyMM46LlzsiapsMRuBYzLMnWPCwutle55s95g0Rt052DQHvXjara-WC5gzIF4z10ZHcN5fsm-ipXMhIGHpi80W6YFD1X0LxFb0-dSQ99-aj8uy74iLSWYZNpuOMcxi7cCbiJZwFkG44CWMc1kUT3QtKhonLEi7bnncBBKLdMgUM9bvBhI6CJcAdfh9Wp1s7wNz9e3NzAuGGLHxWzz27Luvbn-spkv67b1-Zeru_UV3l39Hi4usOVEx-fbT5vlbNH1hje3i3k4v766uZ1d3YaXs_nm-ubQsbreXM5eNl-sL9eH1jVIavMSzqXSlqUov3k0IEyESs2yXU732qNO0B_AdwIf6LxX-uuxclFpRZxVXBBCc6bjLUj9V7ET2iX0Gn6lLAWhiRax0pymcUzNvbSgdAOtO2lkBDZjH6ksQJfC0K3kHCyR3rV2suDMCorGdtRWF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