Bug 100928 - exported opengl function in generated dll was mangled when building with msvc 2015 Update 3
Summary: exported opengl function in generated dll was mangled when building with msvc...
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/swr (show other bugs)
Version: 17.1
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-04 12:58 UTC by jon yang
Modified: 2017-05-09 16:20 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
this is opengl32.def and smooth_opengl3.c to reproduce the problem (12.13 KB, application/zip)
2017-05-04 12:58 UTC, jon yang
Details

Description jon yang 2017-05-04 12:58:49 UTC
Created attachment 131204 [details]
this is opengl32.def and smooth_opengl3.c to reproduce the problem

I use llvm3.7.1 and llvm3.9.1 mesa3d version 17.0.5 with msvc 2015 Update 3. I build as follows:

scons platforms=windows machine=x86 libgl-gdi build=release swr=1

I attached gendef mingw output opengl32.def and freeglut demo program to reproduce the problem. 

The freeglut demo samples is smooth_opengl3.c was failing to create opengl 3 core context on windows 7. This works fine if I build llvmpipe on old unmaintained distros debian, the smooth_opengl3.c freeglut demo was working fine.
Comment 1 jon yang 2017-05-04 13:14:00 UTC
Im not sure if this could be resolved by using this
#pragma comment(linker, "/EXPORT:" __FUNCTION__"=" __FUNCDNAME__)

Quick google search found this someone answer http://stackoverflow.com/questions/2804893/c-dll-export-decorated-mangled-names/2805560#2805560
Comment 2 George Kyriazis 2017-05-05 16:25:32 UTC
There seems to be multiple issues here.

First of all, swr driver is not buildable with machine=x86 (only compile with 64-bit builds).  I don't understand how you managed to build a 32-bit swr driver.

Second, on windows, it looks like both swr and llvmpipe advertise 3.0 core profile.  The smooth_opengl3.c test that was attached, explicitly asks for 3.1, which, of course, cannot be provided.

It looks like there is a mesa OS dependence on the advertised core profile.  It looks like Windows advertises 3.0, while linux advertises 3.3, at least for llvmpipe and swr drivers.

It doesn't look like it's a swr-specific driver bug.
Comment 3 jon yang 2017-05-06 14:40:27 UTC
yeah you right my linux build is x64. And on windows is I just missing very tiny stuff MESA_GL_VERSION_OVERRIDE . you can close this bug as this is a false positive bug.

thank you.
Comment 4 George Kyriazis 2017-05-09 16:20:02 UTC
Alternatively, you could use wglCreateContextAttribsARB().

Closing as not a bug.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.