Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMBREE_STATIC_LIB has no effect due to header include order fiasco #493

Closed
alvinhochun opened this issue Jul 10, 2024 · 0 comments
Closed

Comments

@alvinhochun
Copy link
Contributor

alvinhochun commented Jul 10, 2024

It looks like configuring with EMBREE_STATIC_LIB should cause dll_export to be defined as empty as opposed to __declspec(dllexport) in common/sys/platform.h. In practice this does not work because in common/tasking/taskschedulerinternal.h, #include "../../include/embree4/rtcore.h", in which EMBREE_STATIC_LIB is defined, is placed very late compared to #include "../sys/platform.h", in which the define is supposed to take effect. This causes some of the functions in TaskScheduler to be exported when linked to the final executable even though they really shouldn't be.

> llvm-readobj --coff-exports bin\godot.windows.editor.dev.x86_64.exe

File: bin\godot.windows.editor.dev.x86_64.exe
Format: COFF-x86-64
Arch: x86_64
AddressSize: 64bit
[...]
Export {
  Ordinal: 3
  Name: _ZN6embree13TaskScheduler10ThreadPool12startThreadsEv
  RVA: 0x5A147E0
}
Export {
  Ordinal: 4
  Name: _ZN6embree13TaskScheduler10ThreadPool3addERKNS_3RefIS0_EE
  RVA: 0x5A14B70
}
Export {
  Ordinal: 5
  Name: _ZN6embree13TaskScheduler10ThreadPool6removeERKNS_3RefIS0_EE
  RVA: 0x5A14BF0
}
Export {
  Ordinal: 6
  Name: _ZN6embree13TaskScheduler10swapThreadEPNS0_6ThreadE
  RVA: 0x5A156D0
}
Export {
  Ordinal: 7
  Name: _ZN6embree13TaskScheduler11threadCountEv
  RVA: 0x5A15220
}
Export {
  Ordinal: 8
  Name: _ZN6embree13TaskScheduler11threadIndexEv
  RVA: 0x5A15350
}
Export {
  Ordinal: 9
  Name: _ZN6embree13TaskScheduler12addSchedulerERKNS_3RefIS0_EE
  RVA: 0x5A159D0
}
Export {
  Ordinal: 10
  Name: _ZN6embree13TaskScheduler12startThreadsEv
  RVA: 0x5A159A0
}
Export {
  Ordinal: 11
  Name: _ZN6embree13TaskScheduler15removeSchedulerERKNS_3RefIS0_EE
  RVA: 0x5A15A60
}
Export {
  Ordinal: 12
  Name: _ZN6embree13TaskScheduler16allocThreadIndexEv
  RVA: 0x5A14C80
}
Export {
  Ordinal: 13
  Name: _ZN6embree13TaskScheduler4Task3runERNS0_6ThreadE
  RVA: 0x5A14350
}
Export {
  Ordinal: 14
  Name: _ZN6embree13TaskScheduler4waitEv
  RVA: 0x5A15700
}
Export {
  Ordinal: 15
  Name: _ZN6embree13TaskScheduler6threadEv
  RVA: 0x5A15320
}
Export {
  Ordinal: 16
  Name: _ZN6embree13TaskScheduler8instanceEv
  RVA: 0x5A15390
}
Export {
  Ordinal: 17
  Name: _ZN6embree13TaskScheduler8threadIDEv
  RVA: 0x5A152E0
}
Export {
  Ordinal: 18
  Name: _ZN6embree13TaskScheduler9TaskQueue13execute_localERNS0_6ThreadEPNS0_4TaskE
  RVA: 0x5A14450
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant