ohos: Fix x86_64-unknown-linux-ohos (#33029)

* ohos: Fix compilation for x86_64

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* ohos: Use the SDK compiler-wrapper

When compiling for x86_64-unknown-linux-ohos without the compiler
wrapper, for some reason mozjs_sys will be refercing a wrong mangled symbol
resulting in the following error when loading the .so at runtime:

```
_ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE: symbol not found
```

This problem does not occur when compiling for aarch64 or when using the compiler wrapper.
In this case the correct symbol
`_ZNSt4__n111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE`
is referenced.
It's unclear why manually passing the flags via CFLAGS / CXXFLAGS does not work.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
This commit is contained in:
Jonathan Schwender 2024-08-14 09:30:04 +08:00 committed by GitHub
parent 478d95d245
commit 3aef023368
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 10 additions and 7 deletions

View file

@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
arch: ['aarch64-unknown-linux-ohos']
arch: ['aarch64-unknown-linux-ohos', 'x86_64-unknown-linux-ohos']
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'