Building libgl-gdi on Windows fails with "opengl32.def is static and is not compatible with shared target"

Koehne Kai <[email protected]>
Newsgroups gmane.comp.video.mesa3d.user
Message-ID <[email protected]>
Hi,

I'm trying to build opengl32.dll on Windows (tried both 10.2.2, 10.0.2), and I'm _almost_ there. But linking fails with

scons: *** [build\windows-x86\gallium\targets\libgl-gdi\opengl32.dll] Source file: src\gallium\state_trackers\wgl\opengl32.def is static and is not compatible with shared target: build\windows-x86\gallium\targets\libgl-gdi\opengl32.dll

And I'm pretty clueless what's the culprit here. Has anyone seen this error before? Any hint what I should investigate?


Here's my setup:

== Python ==

I'm using Python 2.7.6 with latest libxml2, py2win32, and scons 2.3.2 . Tried both 32 bit and 64 bit version of Python.

== LLVM ==

I built the release_34 branch of llvm.git with

cmake -G "Visual Studio 10 2010" -DCMAKE_INSTALL_PREFIX=D:\dev\llvm\34\msvc-2010-32 -DLLVM_USE_CRT_RELEASE=MT  -DLLVM_TARGETS_TO_BUILD=X86 ..\..\src
msbuild /p:Configuration=Release ALL_BUILD.vcxproj
msbuild /p:Configuration=Release INSTALL.vcxproj

== Mesa ==

Tried mesa-10.0.2, mesa-10.2.2 tags from git, and tweaked SConstruct to use Visual Studio 2010 32 bit:

--- a/SConstruct
+++ b/SConstruct
@@ -37,6 +37,8 @@ env = Environment(
        options = opts,
        tools = ['gallium'],
        toolpath = ['#scons'],
+       MSVC_VERSION = "10.0",
+       TARGET_ARCH = "x86",
        ENV = os.environ,
 )

(For 10.2.2 I also had to disable one assert in code to get it compiled:)

--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -326,7 +326,7 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
                             GLenum target)
 {
    /* target = GL_TEXTURE_RECTANGLE is not supported in GLES 3.0 */
-   assert(_mesa_is_desktop_gl(ctx) || target == GL_TEXTURE_2D);
+   //assert(_mesa_is_desktop_gl(ctx) || target == GL_TEXTURE_2D);

    unsigned texcoord_size = 2 + (src_rb->Depth > 1 ? 1 : 0);


== Compile Output ==

D:..> set LLVM=D:\dev\llvm\34\msvc-2010-32
D:..> set "PATH=D:\mingw-32\msys\1.0\bin;%PATH%"
D:..> c:\Python27\Scripts\scons.bat build=release llvm=yes libgl-gdi
scons: Reading SConscript files ...
Mkdir("build\windows-x86")
scons: warning: Visual Studio versions prior to 2012 are known to produce incorrect code when optimizations are enabled ( https://bugs.freedesktop.org/show_bug.cgi?id=58718 )
scons: Found LLVM version 3.4.2
Checking for X11 (x11 xext xdamage xfixes)... no
Checking for XCB (x11-xcb xcb-glx >= 1.8.1)... no
Checking for XF86VIDMODE (xxf86vm)... no
Checking for DRM (libdrm >= 2.4.24)... no
Checking for DRM_INTEL (libdrm_intel >= 2.4.30)... no
Checking for XORG (xorg-server >= 1.6.0)... no
Checking for KMS (libkms >= 2.4.24)... no
Checking for UDEV (libudev > 150)... no
scons: done reading SConscript files.
scons: Building targets ...
[...]
  Archiving build\windows-x86\gallium\auxiliary\gallium.lib ...
Using tempfile c:\users\kakoehne\appdata\local\temp\tmpbcs78r.lnk for command line:
lib /nologo /LTCG /OUT:build\windows-x86\gallium\auxiliary\gallium.lib build\windows-x86\gallium\auxiliary\cso_cache\cso_cache.obj build\windows-x86\gallium\auxiliary\cso_cache\cso_context.obj build\windows-x86\gallium\auxiliary\cso_cache\cso_hash.obj build\windows-x86\gallium\auxiliary\draw\draw_context.obj build\windows-x86\gallium\auxiliary\draw\draw_fs.obj build\windows-x86\gallium\auxiliary\draw\draw_gs.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_aaline.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_aapoint.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_clip.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_cull.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_flatshade.obj build\windows-x86\g
 allium\auxiliary\draw\draw_pipe_offset.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_pstipple.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_stipple.obj build\windows-x86\gallium\au
 xiliary\draw\draw_pipe_twoside.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_unfilled.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_util.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_validate.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_vbuf.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_wide_line.obj build\windows-x86\gallium\auxiliary\draw\draw_pipe_wide_point.obj build\windows-x86\gallium\auxiliary\draw\draw_prim_assembler.obj build\windows-x86\gallium\auxiliary\draw\draw_pt.obj build\windows-x86\gallium\auxiliary\draw\draw_pt_emit.obj build\windows-x86\gallium\auxiliary\draw\draw_pt_fetch.obj build\windows-x86\gallium\auxiliary\draw\draw_pt_fetch_emit.obj build\windows-x86\gallium\auxiliary\draw\draw_pt_fetch_shade_emit.obj build\windows-x8
 6\gallium\auxiliary\draw\draw_pt_fetch_shade_pipeline.obj build\windows-x86\gallium\auxiliary\draw\draw_pt_post_vs.obj build\windows-x86\gallium\auxiliary\draw\draw_pt_so_emit.obj build\windows-x86\
 gallium\auxiliary\draw\draw_pt_util.obj build\windows-x86\gallium\auxiliary\draw\draw_pt_vsplit.obj build\windows-x86\gallium\auxiliary\draw\draw_vertex.obj build\windows-x86\gallium\auxiliary\draw\draw_vs.obj build\windows-x86\gallium\auxiliary\draw\draw_vs_exec.obj build\windows-x86\gallium\auxiliary\draw\draw_vs_variant.obj build\windows-x86\gallium\auxiliary\hud\font.obj build\windows-x86\gallium\auxiliary\hud\hud_context.obj build\windows-x86\gallium\auxiliary\hud\hud_cpu.obj build\windows-x86\gallium\auxiliary\hud\hud_fps.obj build\windows-x86\gallium\auxiliary\hud\hud_driver_query.obj build\windows-x86\gallium\auxiliary\indices\u_primconvert.obj build\windows-x86\gallium\auxiliary\os\os_misc.obj build\windows-x86\gallium\auxiliary\os\os_process.obj build\windows-x86\gallium\auxilia
 ry\os\os_time.obj build\windows-x86\gallium\auxiliary\pipebuffer\pb_buffer_fenced.obj build\windows-x86\gallium\auxiliary\pipebuffer\pb_buffer_malloc.obj build\windows-x86\gallium\auxiliary\pipebuff
 er\pb_bufmgr_alt.obj build\windows-x86\gallium\auxiliary\pipebuffer\pb_bufmgr_cache.obj build\windows-x86\gallium\auxiliary\pipebuffer\pb_bufmgr_debug.obj build\windows-x86\gallium\auxiliary\pipebuffer\pb_bufmgr_mm.obj build\windows-x86\gallium\auxiliary\pipebuffer\pb_bufmgr_ondemand.obj build\windows-x86\gallium\auxiliary\pipebuffer\pb_bufmgr_pool.obj build\windows-x86\gallium\auxiliary\pipebuffer\pb_bufmgr_slab.obj build\windows-x86\gallium\auxiliary\pipebuffer\pb_validate.obj build\windows-x86\gallium\auxiliary\postprocess\pp_celshade.obj build\windows-x86\gallium\auxiliary\postprocess\pp_colors.obj build\windows-x86\gallium\auxiliary\postprocess\pp_init.obj build\windows-x86\gallium\auxiliary\postprocess\pp_mlaa.obj build\windows-x86\gallium\auxiliary\postprocess\pp_run.obj build\wind
 ows-x86\gallium\auxiliary\postprocess\pp_program.obj build\windows-x86\gallium\auxiliary\rbug\rbug_connection.obj build\windows-x86\gallium\auxiliary\rbug\rbug_context.obj build\windows-x86\gallium\
 auxiliary\rbug\rbug_core.obj build\windows-x86\gallium\auxiliary\rbug\rbug_demarshal.obj build\windows-x86\gallium\auxiliary\rbug\rbug_texture.obj build\windows-x86\gallium\auxiliary\rbug\rbug_shader.obj build\windows-x86\gallium\auxiliary\rtasm\rtasm_cpu.obj build\windows-x86\gallium\auxiliary\rtasm\rtasm_execmem.obj build\windows-x86\gallium\auxiliary\rtasm\rtasm_x86sse.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_build.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_dump.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_exec.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_info.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_iterate.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_parse.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_sanity.obj build\windows-x86\gallium\au
 xiliary\tgsi\tgsi_scan.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_strings.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_text.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_transform.ob
 j build\windows-x86\gallium\auxiliary\tgsi\tgsi_ureg.obj build\windows-x86\gallium\auxiliary\tgsi\tgsi_util.obj build\windows-x86\gallium\auxiliary\translate\translate.obj build\windows-x86\gallium\auxiliary\translate\translate_cache.obj build\windows-x86\gallium\auxiliary\translate\translate_generic.obj build\windows-x86\gallium\auxiliary\translate\translate_sse.obj build\windows-x86\gallium\auxiliary\util\u_debug.obj build\windows-x86\gallium\auxiliary\util\u_debug_describe.obj build\windows-x86\gallium\auxiliary\util\u_debug_memory.obj build\windows-x86\gallium\auxiliary\util\u_debug_refcnt.obj build\windows-x86\gallium\auxiliary\util\u_debug_stack.obj build\windows-x86\gallium\auxiliary\util\u_debug_symbol.obj build\windows-x86\gallium\auxiliary\util\u_dump_defines.obj build\windows-x
 86\gallium\auxiliary\util\u_dump_state.obj build\windows-x86\gallium\auxiliary\util\u_bitmask.obj build\windows-x86\gallium\auxiliary\util\u_blit.obj build\windows-x86\gallium\auxiliary\util\u_blitt
 er.obj build\windows-x86\gallium\auxiliary\util\u_cache.obj build\windows-x86\gallium\auxiliary\util\u_caps.obj build\windows-x86\gallium\auxiliary\util\u_cpu_detect.obj build\windows-x86\gallium\auxiliary\util\u_dl.obj build\windows-x86\gallium\auxiliary\util\u_draw.obj build\windows-x86\gallium\auxiliary\util\u_draw_quad.obj build\windows-x86\gallium\auxiliary\util\u_format.obj build\windows-x86\gallium\auxiliary\util\u_format_other.obj build\windows-x86\gallium\auxiliary\util\u_format_latc.obj build\windows-x86\gallium\auxiliary\util\u_format_s3tc.obj build\windows-x86\gallium\auxiliary\util\u_format_rgtc.obj build\windows-x86\gallium\auxiliary\util\u_format_etc.obj build\windows-x86\gallium\auxiliary\util\u_format_tests.obj build\windows-x86\gallium\auxiliary\util\u_format_yuv.obj bui
 ld\windows-x86\gallium\auxiliary\util\u_format_zs.obj build\windows-x86\gallium\auxiliary\util\u_framebuffer.obj build\windows-x86\gallium\auxiliary\util\u_gen_mipmap.obj build\windows-x86\gallium\a
 uxiliary\util\u_handle_table.obj build\windows-x86\gallium\auxiliary\util\u_hash.obj build\windows-x86\gallium\auxiliary\util\u_hash_table.obj build\windows-x86\gallium\auxiliary\util\u_helpers.obj build\windows-x86\gallium\auxiliary\util\u_index_modify.obj build\windows-x86\gallium\auxiliary\util\u_keymap.obj build\windows-x86\gallium\auxiliary\util\u_linear.obj build\windows-x86\gallium\auxiliary\util\u_linkage.obj build\windows-x86\gallium\auxiliary\util\u_network.obj build\windows-x86\gallium\auxiliary\util\u_math.obj build\windows-x86\gallium\auxiliary\util\u_mm.obj build\windows-x86\gallium\auxiliary\util\u_pstipple.obj build\windows-x86\gallium\auxiliary\util\u_ringbuffer.obj build\windows-x86\gallium\auxiliary\util\u_sampler.obj build\windows-x86\gallium\auxiliary\util\u_simple_sh
 aders.obj build\windows-x86\gallium\auxiliary\util\u_slab.obj build\windows-x86\gallium\auxiliary\util\u_snprintf.obj build\windows-x86\gallium\auxiliary\util\u_staging.obj build\windows-x86\gallium
 \auxiliary\util\u_suballoc.obj build\windows-x86\gallium\auxiliary\util\u_surface.obj build\windows-x86\gallium\auxiliary\util\u_surfaces.obj build\windows-x86\gallium\auxiliary\util\u_texture.obj build\windows-x86\gallium\auxiliary\util\u_tile.obj build\windows-x86\gallium\auxiliary\util\u_transfer.obj build\windows-x86\gallium\auxiliary\util\u_resource.obj build\windows-x86\gallium\auxiliary\util\u_upload_mgr.obj build\windows-x86\gallium\auxiliary\util\u_vbuf.obj build\windows-x86\gallium\auxiliary\vl\vl_csc.obj build\windows-x86\gallium\auxiliary\vl\vl_compositor.obj build\windows-x86\gallium\auxiliary\vl\vl_matrix_filter.obj build\windows-x86\gallium\auxiliary\vl\vl_median_filter.obj build\windows-x86\gallium\auxiliary\vl\vl_decoder.obj build\windows-x86\gallium\auxiliary\vl\vl_mpeg1
 2_decoder.obj build\windows-x86\gallium\auxiliary\vl\vl_mpeg12_bitstream.obj build\windows-x86\gallium\auxiliary\vl\vl_zscan.obj build\windows-x86\gallium\auxiliary\vl\vl_idct.obj build\windows-x86\
 gallium\auxiliary\vl\vl_mc.obj build\windows-x86\gallium\auxiliary\vl\vl_vertex_buffers.obj build\windows-x86\gallium\auxiliary\vl\vl_video_buffer.obj build\windows-x86\gallium\auxiliary\indices\u_indices_gen.obj build\windows-x86\gallium\auxiliary\indices\u_unfilled_gen.obj build\windows-x86\gallium\auxiliary\util\u_format_srgb.obj build\windows-x86\gallium\auxiliary\util\u_format_table.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_arit.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_arit_overflow.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_assert.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_bitarit.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_const.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_conv.obj build\windows-x86\gallium\aux
 iliary\gallivm\lp_bld_flow.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_format_aos.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_format_aos_array.obj build\windows-x86\gallium\aux
 iliary\gallivm\lp_bld_format_float.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_format_srgb.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_format_soa.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_format_yuv.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_gather.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_init.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_intr.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_logic.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_pack.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_printf.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_quad.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_sample.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_sample_aos.obj build\wi
 ndows-x86\gallium\auxiliary\gallivm\lp_bld_sample_soa.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_struct.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_swizzle.obj build\windows-x
 86\gallium\auxiliary\gallivm\lp_bld_tgsi.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_tgsi_action.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_tgsi_aos.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_tgsi_info.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_tgsi_soa.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_type.obj build\windows-x86\gallium\auxiliary\draw\draw_llvm.obj build\windows-x86\gallium\auxiliary\draw\draw_llvm_sample.obj build\windows-x86\gallium\auxiliary\draw\draw_vs_llvm.obj build\windows-x86\gallium\auxiliary\draw\draw_pt_fetch_shade_pipeline_llvm.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_debug.obj build\windows-x86\gallium\auxiliary\gallivm\lp_bld_misc.obj
scons: *** [build\windows-x86\gallium\targets\libgl-gdi\opengl32.dll] Source file: src\gallium\state_trackers\wgl\opengl32.def is static and is not compatible with shared target: build\windows-x86\gallium\targets\libgl-gdi\opengl32.dll
scons: building terminated because of errors.



Any help is appreciated.

Regards

Kai
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.