Function alignment #22369
Unanswered
ethanaobrien
asked this question in
Q&A
Function alignment
#22369
Replies: 1 comment 12 replies
-
Yes, this looks like a clang bug. Testcase: void foo() {}
void bar() {}
int main(int argc, char **argv) {
if (argc == 17) return (int)&foo;
else return (int)&bar;
} Compiling with or without @sbc100 is this a bug in wasm-ld specifically perhaps, I think the table is laid out there? |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on compiling a certain emulator via emscripten, where the lowest bit of every code pointer needs to be zero.
Setting
-falign-functions=2
. Though this appears to be ignored (with no warnings from the compiler)https://github.com/libretro/picodrive/blob/d6f625a1251c78caf6f2dc81c1ffdb724587bb24/Makefile#L26
Is there a hacky way to get this done with a modern build of emscripten?
(P.S. The "EMULATED_FUNCTION_POINTERS" option seems to have disappeared without a trace)
Beta Was this translation helpful? Give feedback.
All reactions