8cabc7be1d
- recent gdb handles DWARF fine (tested both with version 7.1.90.20100730 from mingw-w64 project, and 7.5-1 from mingw project) - http://people.freedesktop.org/~jrfonseca/bfdhelp/ was updated to handle DWARF - stabs requires ugly hacks to prevent compilation failures - mixing stabs/dwarf prevents proper backtraces (which is inevitable, given that the MinGW C runtime is pre-built with DWARF) For example, without this change I get: (gdb) bt #0 _wassert (_Message=0xf925060 L"Num < NumOperands && \"Invalid child # of SDNode!\"", _File=0xf60b488 L"llvm/include/llvm/CodeGen/SelectionDAGNodes.h", _Line=534) at ../../../../mingw-w64-crt/misc/wassert.c:51 #1 0x0368996b in _assert (_Message=0x39d7ee4 "Num < NumOperands && \"Invalid child # of SDNode!\"", _File=0x39d7e94 "llvm/include/llvm/CodeGen/SelectionDAGNodes.h", _Line=534) at ../../../../mingw-w64-crt/misc/wassert.c:44 #2 0x00000004 in ?? () #3 0x00000004 in ?? () #4 0x0f60b488 in ?? () #5 0x00000000 in ?? () While with this change I get: (gdb) bt #0 _wassert (_Message=0xfb982e8 L"Num < NumOperands && \"Invalid child # of SDNode!\"", _File=0xefbcb40 L"llvm/include/llvm/CodeGen/SelectionDAGNodes.h", _Line=534) at ../../../../mingw-w64-crt/misc/wassert.c:51 #1 0x039c996b in _assert (_Message=0x3d17f24 "Num < NumOperands && \"Invalid child # of SDNode!\"", _File=0x3d17ed4 "llvm/include/llvm/CodeGen/SelectionDAGNodes.h", _Line=534) at ../../../../mingw-w64-crt/misc/wassert.c:44 #2 0x033111cc in getOperand (Num=4, this=<optimized out>) at llvm/include/llvm/CodeGen/SelectionDAGNodes.h:534 #3 getOperand (i=4, this=<optimized out>) at llvm/include/llvm/CodeGen/SelectionDAGNodes.h:779 #4 llvm::SelectionDAG::getNode (this=0xf00cb08, Opcode=79, DL=..., VT=..., N1=..., N2=...) at llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2859 #5 0x03377b20 in llvm::SelectionDAGBuilder::visitExtractElement (this=0xfb45028, I=...) at llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:2803 [...] Reviewed-by: Brian Paul <brianp@vmware.com>
103 lines
2.6 KiB
Python
103 lines
2.6 KiB
Python
#######################################################################
|
|
# SConscript for glapi
|
|
|
|
|
|
from sys import executable as python_cmd
|
|
|
|
Import('*')
|
|
|
|
env = env.Clone()
|
|
|
|
env.Append(CPPDEFINES = [
|
|
'MAPI_MODE_UTIL',
|
|
])
|
|
|
|
if env['platform'] == 'windows':
|
|
env.Append(CPPDEFINES = [
|
|
'_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
|
|
'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
|
|
])
|
|
if env['gles']:
|
|
env.Append(CPPDEFINES = ['_GLAPI_DLL_EXPORTS'])
|
|
else:
|
|
# prevent _glapi_* from being declared __declspec(dllimport)
|
|
env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
|
|
|
|
env.Append(CPPPATH = [
|
|
'#/src/mapi',
|
|
'#/src/mesa',
|
|
Dir('..'), # src/mapi build path
|
|
])
|
|
|
|
glapi_sources = [
|
|
'glapi_dispatch.c',
|
|
'glapi_entrypoint.c',
|
|
'glapi_getproc.c',
|
|
'glapi_nop.c',
|
|
'glthread.c',
|
|
'glapi.c',
|
|
]
|
|
|
|
mapi_sources = [
|
|
'u_current.c',
|
|
'u_execmem.c',
|
|
]
|
|
for s in mapi_sources:
|
|
o = env.SharedObject(s[:-2], '../' + s)
|
|
glapi_sources.append(o)
|
|
|
|
#
|
|
# Assembly sources
|
|
#
|
|
if (env['gcc'] or env['clang']) and \
|
|
env['platform'] not in ('cygwin', 'darwin', 'windows'):
|
|
GLAPI = '#src/mapi/glapi/'
|
|
|
|
if env['machine'] == 'x86':
|
|
env.Append(CPPDEFINES = [
|
|
'USE_X86_ASM',
|
|
])
|
|
glapi_sources += [
|
|
'glapi_x86.S',
|
|
]
|
|
env.CodeGenerate(
|
|
target = 'glapi_x86.S',
|
|
script = GLAPI + 'gen/gl_x86_asm.py',
|
|
source = GLAPI + 'gen/gl_and_es_API.xml',
|
|
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
|
|
)
|
|
elif env['machine'] == 'x86_64':
|
|
env.Append(CPPDEFINES = [
|
|
'USE_X86_64_ASM',
|
|
])
|
|
glapi_sources += [
|
|
'glapi_x86-64.S'
|
|
]
|
|
env.CodeGenerate(
|
|
target = 'glapi_x86-64.S',
|
|
script = GLAPI + 'gen/gl_x86-64_asm.py',
|
|
source = GLAPI + 'gen/gl_and_es_API.xml',
|
|
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
|
|
)
|
|
elif env['machine'] == 'sparc':
|
|
env.Append(CPPDEFINES = [
|
|
'USE_SPARC_ASM',
|
|
])
|
|
glapi_sources += [
|
|
'glapi_sparc.S'
|
|
]
|
|
env.CodeGenerate(
|
|
target = 'glapi_sparc.S',
|
|
script = GLAPI + 'gen/gl_SPARC_asm.py',
|
|
source = GLAPI + 'gen/gl_and_es_API.xml',
|
|
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
|
|
)
|
|
else:
|
|
pass
|
|
|
|
glapi = env.ConvenienceLibrary(
|
|
target = 'glapi',
|
|
source = glapi_sources,
|
|
)
|
|
Export('glapi')
|