I'm so close to having LLVM build on PowerPC. If there's any PowerPC
experts, help?
Lines like this:
outs() << "[" << format("%2d", i) <<
"]"
<< "(sec " << format("%2d",
int16_t(symbol->SectionNumber)) << ")"
<< "(fl 0x" << format("%02x",
symbol->Type.BaseType) << ")"
<< "(ty " << format("%3x",
symbol->Type.ComplexType) << ")"
<< "(scl " << format("%3x",
symbol->StorageClass) << ") "
<< "(nx " <<
unsigned(symbol->NumberOfAuxSymbols) << ") "
<< "0x" << format("%08x",
symbol->Value) << " "
<< name << "\n";
Are trying to call the format function with
struct coff_symbol {
struct StringTableOffset {
support::ulittle32_t Zeroes;
support::ulittle32_t Offset;
};
union {
char ShortName[8];
StringTableOffset Offset;
} Name;
support::ulittle32_t Value;
support::little16_t SectionNumber;
struct {
support::ulittle8_t BaseType;
support::ulittle8_t ComplexType;
} Type;
support::ulittle8_t StorageClass;
support::ulittle8_t NumberOfAuxSymbols;
};
and on PowerPC it generates errors like:
/Users/jabbey/src/llvm/include/llvm/Support/Format.h: In member function
'int llvm::format_object1<T>::snprint(char*, unsigned int) const [with
T = llvm::support::detail::packed_endian_specific_integral<unsigned int,
little, unaligned>]':
/Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622: instantiated
from here
/Users/jabbey/src/llvm/include/llvm/Support/Format.h:88: warning: cannot pass
objects of non-POD type 'const struct
llvm::support::detail::packed_endian_specific_integral<unsigned int, little,
unaligned>' through '...'; call will abort at runtime
/Users/jabbey/src/llvm/include/llvm/Support/Format.h: In member function
'int llvm::format_object2<T1, T2>::snprint(char*, unsigned int) const
[with T1 = llvm::support::detail::packed_endian_specific_integral<unsigned
char, little, unaligned>, T2 =
llvm::support::detail::packed_endian_specific_integral<unsigned char, little,
unaligned>]':
/Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622: instantiated
from here
/Users/jabbey/src/llvm/include/llvm/Support/Format.h:106: warning: cannot pass
objects of non-POD type 'const struct
llvm::support::detail::packed_endian_specific_integral<unsigned char, little,
unaligned>' through '...'; call will abort at runtime
Can I just cast the value, or would the correct fix be in something like
include/llvm/Support/Endian.h?
Thanks much!
Joe Abbey
Software Architect
Arxan Technologies, Inc.
1305 Cumberland Ave, Ste 215
West Lafayette, IN 47906
jabbey at arxan.com<mailto:jabbey at arxan.com>
www.arxan.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20111018/2e5c83e5/attachment.html>
Well,
This patch gets it to build and it is now running check
Index: tools/llvm-objdump/llvm-objdump.cpp
==================================================================---
tools/llvm-objdump/llvm-objdump.cpp (revision 142319)
+++ tools/llvm-objdump/llvm-objdump.cpp (working copy)
@@ -430,11 +430,11 @@
return;
outs() << "AUX "
<< format("scnlen 0x%x nreloc %d nlnno %d checksum
0x%x "
- , asd->Length
- , asd->NumberOfRelocations
- , asd->NumberOfLinenumbers
- , asd->CheckSum)
- << format("assoc %d comdat %d\n",
asd->Number, asd->Selection);
+ , uint32_t(asd->Length)
+ , uint16_t(asd->NumberOfRelocations)
+ , uint16_t(asd->NumberOfLinenumbers)
+ , uint32_t(asd->CheckSum))
+ << format("assoc %d comdat %d\n",
uint16_t(asd->Number), uint8_t(asd->Selection));
} else {
outs() << "AUX Unknown\n";
}
@@ -444,11 +444,11 @@
if (error(coff->getSymbolName(symbol, name))) return;
outs() << "[" << format("%2d", i)
<< "]"
<< "(sec " << format("%2d",
int16_t(symbol->SectionNumber)) << ")"
- << "(fl 0x" << format("%02x",
symbol->Type.BaseType) << ")"
- << "(ty " << format("%3x",
symbol->Type) << ")"
- << "(scl " << format("%3x",
symbol->StorageClass) << ") "
+ << "(fl 0x" << format("%02x",
uint8_t(symbol->Type.BaseType)) << ")"
+ << "(ty " << format("%3x",
uint8_t(symbol->Type.ComplexType)) << ")"
+ << "(scl " << format("%3x",
uint8_t(symbol->StorageClass)) << ") "
<< "(nx " <<
unsigned(symbol->NumberOfAuxSymbols) << ") "
- << "0x" << format("%08x",
symbol->Value) << " "
+ << "0x" << format("%08x",
uint32_t(symbol->Value)) << " "
<< name << "\n";
aux_count = symbol->NumberOfAuxSymbols;
}
Index: utils/unittest/CMakeLists.txt
==================================================================---
utils/unittest/CMakeLists.txt (revision 142319)
+++ utils/unittest/CMakeLists.txt (working copy)
@@ -40,3 +40,11 @@
add_llvm_library(gtest_main
UnitTestMain/TestMain.cpp
)
+
+add_llvm_library_dependencies(gtest
+ LLVMSupport
+ )
+
+add_llvm_library_dependencies(gtest_main
+ gtest
+ )
Index: lib/ExecutionEngine/JIT/CMakeLists.txt
==================================================================---
lib/ExecutionEngine/JIT/CMakeLists.txt (revision 142319)
+++ lib/ExecutionEngine/JIT/CMakeLists.txt (working copy)
@@ -17,4 +17,5 @@
LLVMRuntimeDyld
LLVMSupport
LLVMTarget
+ LLVMCodeGen
)
But I really don't like that "fix". Makes the code difficult to
read. If anyone groks the Endian templates and know what should be/could be
fixed, that'd be helpful.
arxan_bellini may be useful after all.
Cheers,
Joe Abbey
Software Architect
Arxan Technologies, Inc.
1305 Cumberland Ave, Ste 215
West Lafayette, IN 47906
jabbey at arxan.com<mailto:jabbey at arxan.com>
www.arxan.com
On Oct 18, 2011, at 7:25 PM, Joe Abbey wrote:
I'm so close to having LLVM build on PowerPC. If there's any PowerPC
experts, help?
Lines like this:
outs() << "[" << format("%2d", i) <<
"]"
<< "(sec " << format("%2d",
int16_t(symbol->SectionNumber)) << ")"
<< "(fl 0x" << format("%02x",
symbol->Type.BaseType) << ")"
<< "(ty " << format("%3x",
symbol->Type.ComplexType) << ")"
<< "(scl " << format("%3x",
symbol->StorageClass) << ") "
<< "(nx " <<
unsigned(symbol->NumberOfAuxSymbols) << ") "
<< "0x" << format("%08x",
symbol->Value) << " "
<< name << "\n";
Are trying to call the format function with
struct coff_symbol {
struct StringTableOffset {
support::ulittle32_t Zeroes;
support::ulittle32_t Offset;
};
union {
char ShortName[8];
StringTableOffset Offset;
} Name;
support::ulittle32_t Value;
support::little16_t SectionNumber;
struct {
support::ulittle8_t BaseType;
support::ulittle8_t ComplexType;
} Type;
support::ulittle8_t StorageClass;
support::ulittle8_t NumberOfAuxSymbols;
};
and on PowerPC it generates errors like:
/Users/jabbey/src/llvm/include/llvm/Support/Format.h: In member function
'int llvm::format_object1<T>::snprint(char*, unsigned int) const [with
T = llvm::support::detail::packed_endian_specific_integral<unsigned int,
little, unaligned>]':
/Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622: instantiated
from here
/Users/jabbey/src/llvm/include/llvm/Support/Format.h:88: warning: cannot pass
objects of non-POD type 'const struct
llvm::support::detail::packed_endian_specific_integral<unsigned int, little,
unaligned>' through '...'; call will abort at runtime
/Users/jabbey/src/llvm/include/llvm/Support/Format.h: In member function
'int llvm::format_object2<T1, T2>::snprint(char*, unsigned int) const
[with T1 = llvm::support::detail::packed_endian_specific_integral<unsigned
char, little, unaligned>, T2 =
llvm::support::detail::packed_endian_specific_integral<unsigned char, little,
unaligned>]':
/Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622: instantiated
from here
/Users/jabbey/src/llvm/include/llvm/Support/Format.h:106: warning: cannot pass
objects of non-POD type 'const struct
llvm::support::detail::packed_endian_specific_integral<unsigned char, little,
unaligned>' through '...'; call will abort at runtime
Can I just cast the value, or would the correct fix be in something like
include/llvm/Support/Endian.h?
Thanks much!
Joe Abbey
Software Architect
Arxan Technologies, Inc.
1305 Cumberland Ave, Ste 215
West Lafayette, IN 47906
jabbey at arxan.com<mailto:jabbey at arxan.com>
www.arxan.com<http://www.arxan.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20111018/ab89ba6a/attachment.html>
On Tue, Oct 18, 2011 at 4:25 PM, Joe Abbey <jabbey at arxan.com> wrote:> I'm so close to having LLVM build on PowerPC. If there's any PowerPC > experts, help? > Lines like this: > outs() << "[" << format("%2d", i) << "]" > << "(sec " << format("%2d", int16_t(symbol->SectionNumber)) << > ")" > << "(fl 0x" << format("%02x", symbol->Type.BaseType) << ")" > << "(ty " << format("%3x", symbol->Type.ComplexType) << ")" > << "(scl " << format("%3x", symbol->StorageClass) << ") " > << "(nx " << unsigned(symbol->NumberOfAuxSymbols) << ") " > << "0x" << format("%08x", symbol->Value) << " " > << name << "\n"; > Are trying to call the format function with > struct coff_symbol { > struct StringTableOffset { > support::ulittle32_t Zeroes; > support::ulittle32_t Offset; > }; > union { > char ShortName[8]; > StringTableOffset Offset; > } Name; > support::ulittle32_t Value; > support::little16_t SectionNumber; > struct { > support::ulittle8_t BaseType; > support::ulittle8_t ComplexType; > } Type; > support::ulittle8_t StorageClass; > support::ulittle8_t NumberOfAuxSymbols; > }; > and on PowerPC it generates errors like: > /Users/jabbey/src/llvm/include/llvm/Support/Format.h: In member function > 'int llvm::format_object1<T>::snprint(char*, unsigned int) const [with T > llvm::support::detail::packed_endian_specific_integral<unsigned int, little, > unaligned>]': > /Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622: > instantiated from here > /Users/jabbey/src/llvm/include/llvm/Support/Format.h:88: warning: cannot > pass objects of non-POD type 'const struct > llvm::support::detail::packed_endian_specific_integral<unsigned int, little, > unaligned>' through '...'; call will abort at runtime > /Users/jabbey/src/llvm/include/llvm/Support/Format.h: In member function > 'int llvm::format_object2<T1, T2>::snprint(char*, unsigned int) const [with > T1 = llvm::support::detail::packed_endian_specific_integral<unsigned char, > little, unaligned>, T2 > llvm::support::detail::packed_endian_specific_integral<unsigned char, > little, unaligned>]': > /Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622: > instantiated from here > /Users/jabbey/src/llvm/include/llvm/Support/Format.h:106: warning: cannot > pass objects of non-POD type 'const struct > llvm::support::detail::packed_endian_specific_integral<unsigned char, > little, unaligned>' through '...'; call will abort at runtime > Can I just cast the value, or would the correct fix be in something like > include/llvm/Support/Endian.h?Try to "svn up" first. :) -Eli
Oh man r142320 fixed this.
Wow... talk about off-by-one.
Joe
Joe Abbey
Software Architect
Arxan Technologies, Inc.
1305 Cumberland Ave, Ste 215
West Lafayette, IN 47906
jabbey at arxan.com<mailto:jabbey at arxan.com>
www.arxan.com
On Oct 18, 2011, at 8:01 PM, Eli Friedman wrote:
On Tue, Oct 18, 2011 at 4:25 PM, Joe Abbey <jabbey at
arxan.com<mailto:jabbey at arxan.com>> wrote:
I'm so close to having LLVM build on PowerPC. If there's any PowerPC
experts, help?
Lines like this:
outs() << "[" << format("%2d", i) <<
"]"
<< "(sec " << format("%2d",
int16_t(symbol->SectionNumber)) <<
")"
<< "(fl 0x" << format("%02x",
symbol->Type.BaseType) << ")"
<< "(ty " << format("%3x",
symbol->Type.ComplexType) << ")"
<< "(scl " << format("%3x",
symbol->StorageClass) << ") "
<< "(nx " <<
unsigned(symbol->NumberOfAuxSymbols) << ") "
<< "0x" << format("%08x",
symbol->Value) << " "
<< name << "\n";
Are trying to call the format function with
struct coff_symbol {
struct StringTableOffset {
support::ulittle32_t Zeroes;
support::ulittle32_t Offset;
};
union {
char ShortName[8];
StringTableOffset Offset;
} Name;
support::ulittle32_t Value;
support::little16_t SectionNumber;
struct {
support::ulittle8_t BaseType;
support::ulittle8_t ComplexType;
} Type;
support::ulittle8_t StorageClass;
support::ulittle8_t NumberOfAuxSymbols;
};
and on PowerPC it generates errors like:
/Users/jabbey/src/llvm/include/llvm/Support/Format.h: In member function
'int llvm::format_object1<T>::snprint(char*, unsigned int) const [with
T llvm::support::detail::packed_endian_specific_integral<unsigned int,
little,
unaligned>]':
/Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622:
instantiated from here
/Users/jabbey/src/llvm/include/llvm/Support/Format.h:88: warning: cannot
pass objects of non-POD type 'const struct
llvm::support::detail::packed_endian_specific_integral<unsigned int, little,
unaligned>' through '...'; call will abort at runtime
/Users/jabbey/src/llvm/include/llvm/Support/Format.h: In member function
'int llvm::format_object2<T1, T2>::snprint(char*, unsigned int) const
[with
T1 = llvm::support::detail::packed_endian_specific_integral<unsigned char,
little, unaligned>, T2
llvm::support::detail::packed_endian_specific_integral<unsigned char,
little, unaligned>]':
/Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622:
instantiated from here
/Users/jabbey/src/llvm/include/llvm/Support/Format.h:106: warning: cannot
pass objects of non-POD type 'const struct
llvm::support::detail::packed_endian_specific_integral<unsigned char,
little, unaligned>' through '...'; call will abort at runtime
Can I just cast the value, or would the correct fix be in something like
include/llvm/Support/Endian.h?
Try to "svn up" first. :)
-Eli
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.edu>
http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20111018/4729123c/attachment.html>