<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm so close to having LLVM build on PowerPC. If there's any PowerPC experts, help?<div><br></div><div>Lines like this:</div><div><br></div><div><div> outs() << "[" << format("%2d", i) << "]"</div><div> << "(sec " << format("%2d", int16_t(symbol->SectionNumber)) << ")"</div><div> << "(fl 0x" << format("%02x", symbol->Type.BaseType) << ")"</div><div> << "(ty " << format("%3x", symbol->Type.ComplexType) << ")"</div><div> << "(scl " << format("%3x", symbol->StorageClass) << ") "</div><div> << "(nx " << unsigned(symbol->NumberOfAuxSymbols) << ") "</div><div> << "0x" << format("%08x", symbol->Value) << " "</div><div> << name << "\n";</div><div><br></div><div>Are trying to call the format function with </div><div><br></div><div><div>struct coff_symbol {</div><div> struct StringTableOffset {</div><div> support::ulittle32_t Zeroes;</div><div> support::ulittle32_t Offset;</div><div> };</div><div><br></div><div> union {</div><div> char ShortName[8];</div><div> StringTableOffset Offset;</div><div> } Name;</div><div><br></div><div> support::ulittle32_t Value;</div><div> support::little16_t SectionNumber;</div><div><br></div><div> struct {</div><div> support::ulittle8_t BaseType;</div><div> support::ulittle8_t ComplexType;</div><div> } Type;</div><div><br></div><div> support::ulittle8_t StorageClass;</div><div> support::ulittle8_t NumberOfAuxSymbols;</div><div>};</div></div><div><br></div><div>and on PowerPC it generates errors like:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; ">/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>]':</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; ">/Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622: instantiated from here</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; ">/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</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; ">/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>]':</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; ">/Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622: instantiated from here</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; ">/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</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; ">Can I just cast the value, or would the correct fix be in something like include/llvm/Support/Endian.h?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; ">Thanks much!</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Calibri; "><br></div><div><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Joe Abbey<br>Software Architect<br>Arxan Technologies, Inc.<br>1305 Cumberland Ave, Ste 215<br>West Lafayette, IN 47906<br><a href="mailto:jabbey@arxan.com">jabbey@arxan.com</a><br>www.arxan.com</div>
</div>
<br></div></div></body></html>