[mono] Fix building multiple os/arch combinations in the same working directory ...
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 27 Jul 2020 22:59:51 +0000 (00:59 +0200)
committerGitHub <noreply@github.com>
Mon, 27 Jul 2020 22:59:51 +0000 (00:59 +0200)
commit0168d8e36c5ca3393391f596ac4e57fa31a31402
treeb8ff30110d164029a5b83e3b4a2d6a76737f7475
parentda669c474cc595efce538f33c8de593926a9ee21
[mono] Fix building multiple os/arch combinations in the same working directory (#39970)

After adding the ICU shim code to the runtime we hit an issue when e.g. compiling for "desktop" mono in a working directory that already had Browser wasm artifacts in it.
This is due to automake putting the intermediate compilation artifacts at the same location where a file was referenced from.

This means that e.g. when using `../../../libraries/Native/Unix/System.Globalization.Native/pal_icushim.c` in the Makefile.am we'd get the intermediaries in `artifacts/obj/mono/libraries/` instead of somewhere in `artifacts/obj/mono/OSX.x64.Debug`.

Later on we'd get the following error because it was reusing the existing .o file from another architecture:

```
Undefined symbols for architecture x86_64:
  "_gPalGlobalizationNative", referenced from:
    _c_qcalls in libmonoruntimesgen.a(libmonoruntimesgen_la-native-library-qcall.o)
```

Fix this by symlinking the source files into the build directory.
src/mono/mono/metadata/Makefile.am