- Notifications
You must be signed in to change notification settings - Fork3.5k
Disable FAKE_DYLIBS by default#25930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
| set(CMAKE_CROSSCOMPILINGTRUE) | ||
| set_property(GLOBAL PROPERTYTARGET_SUPPORTS_SHARED_LIBSFALSE) | ||
| set_property(GLOBAL PROPERTYTARGET_SUPPORTS_SHARED_LIBSTRUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@bradking should I just delete line instead? (i.e. does this default to true?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes, theCMakeGenericSystem module initializes the property toTRUE. It doesn't need to be set here.
This means that `-shared` will now produce a dynamic library by default.If you want the old behaviour you now need `-sFAKE_DYLIBS`.
| to behave like:ref:`SIDE_MODULE` and produce and dynamically linked | ||
| library. | ||
| This setting changes the behaviour of the ``-shared`` flag. When set to true | ||
| you get the old emscripten behaivour where the ``-shared`` flag actually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| you get the old emscriptenbehaivour where the ``-shared`` flag actually | |
| you get the old emscriptenbehaviour where the ``-shared`` flag actually |
| cmd.append(stub) | ||
| ifnotsettings.FAKE_DYLIBS: | ||
| cmd.append('-Bdynamic') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Before this was just for main module - why is it different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hmm.. yes I guess this part of the change would be removing the need for-sMAIN_MODULE (i.e. implicitly building a main module when dynamic libraries are present). Maybe that should be left for a followup.
dschuff left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I wonder what would happen if we tested this with Binaryen. it doesn't seemprepared to force the Emscripten build to be static (assuming that's the behavior we actually want).
| # Verify that building with -sSIDE_MODULE is essentailly the same as building with `-shared -fPIC -sFAKE_DYLIBS=0`. | ||
| flags= ['-shared','-fPIC','-sFAKE_DYLIBS=0'] | ||
| # Verify that building with -sSIDE_MODULE is essentailly the same as building with `-shared -fPIC` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| # Verify that building with -sSIDE_MODULE isessentailly the same as building with `-shared -fPIC` | |
| # Verify that building with -sSIDE_MODULE isessentially the same as building with `-shared -fPIC` |
This means that
-sharedwill now produce a dynamic library by default.If you want the old behaviour you now need
-sFAKE_DYLIBS.