gcc 4.3 added a new intrinsic, __builtin_bswap32. Currently CIL doesn't know about this builtin, so will emit a (wrongly-typed) prototype for it, causing undefined references in the output object file. The following patch fixes the problem for me.
diff --git a/src/cil.ml b/src/cil.ml
index 1c737e8..343216f 100644
--- a/src/cil.ml
+++ b/src/cil.ml
@@ -2835,6 +2835,7 @@ let initGccBuiltins () : unit =
(* See if we have builtin_va_list *)
let hasbva = !M.theMachine.M.__builtin_va_list in
let ulongLongType = TInt(IULongLong, []) in
+ let uIntType = TInt(IUInt, []) in
let floatType = TFloat(FFloat, []) in
let longDoubleType = TFloat (FLongDouble, []) in
let voidConstPtrType = TPtr(TVoid [Attr ("const", [])], []) in
@@ -2878,6 +2879,8 @@ let initGccBuiltins () : unit =
H.add h "__builtin_atan2l" (longDoubleType, [ longDoubleType;
longDoubleType ], false);
+ H.add h "__builtin_bswap32" (uIntType, [ uIntType ], false);
+
H.add h "__builtin_ceil" (doubleType, [ doubleType ], false);
H.add h "__builtin_ceilf" (floatType, [ floatType ], false);
H.add h "__builtin_ceill" (longDoubleType, [ longDoubleType ], false);
gcc 4.3 added a new intrinsic, __builtin_bswap32. Currently CIL doesn't know about this builtin, so will emit a (wrongly-typed) prototype for it, causing undefined references in the output object file. The following patch fixes the problem for me.