mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-28 09:40:21 +01:00
gallivm: Make sure the bitcode buffer is followed by a 0 byte.
May fail to parse otherwise.
This commit is contained in:
parent
f43e621e22
commit
45604ffac7
3 changed files with 4 additions and 4 deletions
|
|
@ -66,12 +66,12 @@ depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(INC_SOURCES)
|
|||
|
||||
gallivm_builtins.cpp: llvm_builtins.c
|
||||
clang --emit-llvm < $< |llvm-as|opt -std-compile-opts > temp1.bin
|
||||
(echo "static const unsigned char llvm_builtins_data[] = {"; od -txC temp1.bin | sed -e "s/^[0-9]*//" -e s"/ \([0-9a-f][0-9a-f]\)/0x\1,/g" -e"\$$d" | sed -e"\$$s/,$$/};/") >$@
|
||||
(echo "static const unsigned char llvm_builtins_data[] = {"; od -txC temp1.bin | sed -e "s/^[0-9]*//" -e s"/ \([0-9a-f][0-9a-f]\)/0x\1,/g" -e"\$$d" | sed -e"\$$s/,$$/,0x00};/") >$@
|
||||
rm temp1.bin
|
||||
|
||||
gallivmsoabuiltins.cpp: soabuiltins.c
|
||||
clang --emit-llvm < $< |llvm-as|opt -std-compile-opts > temp2.bin
|
||||
(echo "static const unsigned char soabuiltins_data[] = {"; od -txC temp2.bin | sed -e "s/^[0-9]*//" -e s"/ \([0-9a-f][0-9a-f]\)/0x\1,/g" -e"\$$d" | sed -e"\$$s/,$$/};/") >$@
|
||||
(echo "static const unsigned char soabuiltins_data[] = {"; od -txC temp2.bin | sed -e "s/^[0-9]*//" -e s"/ \([0-9a-f][0-9a-f]\)/0x\1,/g" -e"\$$d" | sed -e"\$$s/,$$/,0x00};/") >$@
|
||||
rm temp2.bin
|
||||
|
||||
# Emacs tags
|
||||
|
|
|
|||
|
|
@ -137,4 +137,4 @@ static const unsigned char llvm_builtins_data[] = {
|
|||
0x58,0x85,0x05,0x14,0xbe,0x34,0x45,0xb5,0x21,0x10,0x82,0x23,0x15,0x46,0x30,0x2c,
|
||||
0xc8,0x64,0x02,0x06,0xf0,0x3c,0x91,0x73,0x19,0x00,0xe1,0x4b,0x53,0x64,0x0a,0x84,
|
||||
0x84,0x34,0x85,0x25,0x0c,0x92,0x20,0x59,0xc1,0x20,0x30,0x8f,0x2d,0x10,0x95,0x84,
|
||||
0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ void InstructionsSoa::createBuiltins()
|
|||
std::string ErrMsg;
|
||||
MemoryBuffer *buffer = MemoryBuffer::getMemBuffer(
|
||||
(const char*)&soabuiltins_data[0],
|
||||
(const char*)&soabuiltins_data[Elements(soabuiltins_data)]);
|
||||
(const char*)&soabuiltins_data[Elements(soabuiltins_data) - 1]);
|
||||
m_builtins = ParseBitcodeFile(buffer, &ErrMsg);
|
||||
std::cout<<"Builtins created at "<<m_builtins<<" ("<<ErrMsg<<")"<<std::endl;
|
||||
assert(m_builtins);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue