mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 17:00:13 +01:00
svga/drm: Optionally resolve calls to powf during link-time
When linked with certain builds of libstdc++, it appears like powf is resolved by a symbol in that library. Other builds of libstdc++ doesn't contain that symbol resulting in a linker / loader error. Optionally resolve that symbol and replace it with calls to logf and expf. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
This commit is contained in:
parent
8e630fad72
commit
0d5b4b320c
2 changed files with 18 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ PIPE_DRIVERS = \
|
|||
|
||||
C_SOURCES = \
|
||||
target.c \
|
||||
vmw_powf.c \
|
||||
$(COMMON_GALLIUM_SOURCES)
|
||||
|
||||
DRIVER_DEFINES = \
|
||||
|
|
|
|||
17
src/gallium/targets/dri-vmwgfx/vmw_powf.c
Normal file
17
src/gallium/targets/dri-vmwgfx/vmw_powf.c
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Powf may leave an unresolved symbol pointing to a libstdc++.so powf.
|
||||
* However, not all libstdc++.so include this function, so optionally
|
||||
* replace the powf function with calls to expf and logf.
|
||||
*/
|
||||
|
||||
#ifdef VMW_RESOLVE_POWF
|
||||
|
||||
extern float expf(float x);
|
||||
extern float logf(float x);
|
||||
extern float powf(float x, float y);
|
||||
|
||||
float powf(float x, float y) {
|
||||
return expf(logf(x)*y);
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Reference in a new issue