Hi, So, after a way to long time gap, I finally found the time to look at this again. This time tried both gcc and clang.
Just dropping the visibility hidden #pragma works fine for gcc. It also works with clang for DEBUG and RELEASE builds, but not for NOOPT builds. > > Automatically detecting freestanding vs. hosted would be even better, > > anyone knows whenever there is a define which can be used for this? At > > least the gcc man page doesn't mention any ... > > > > ard@gambale:~/linux-build-x86$ gcc -dM -E -o - -xc - <<< ""|grep HOSTED > #define __STDC_HOSTED__ 1 > ard@gambale:~/linux-build-x86$ gcc -ffreestanding -dM -E -o - -xc - > <<< ""|grep HOSTED > #define __STDC_HOSTED__ 0 Problem with this is we don't build with -ffreestanding. Simply adding it breaks (not surprisingly) the hosted builds, specifically various test cases such as MdePkg/Test/MdePkgHostTest.dsc. Looking through BaseTools/Conf/tools_def.template I can't see some way to apply options only to hosted or freestanding builds. Apparently that information is not anywhere in the *.inf files, or did I miss something? So back to the approach of adding a #define? take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105121): https://edk2.groups.io/g/devel/message/105121 Mute This Topic: https://groups.io/mt/98257896/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-