hfuzz_cc: link pthread and BlocksRuntime at the end
@@ -282,12 +282,6 @@ static int ldMode(int argc, char **argv)
commonOpts(&j, args);
- /* libcommon.a will use it when compiled with clang */
-#if defined(__clang__)
- args[j++] = "-lBlocksRuntime";
-#endif /* defined(__clang__) */
- args[j++] = "-lpthread";
-
int i;
for (i = 1; i < argc; i++) {
args[j++] = argv[i];
@@ -301,6 +295,12 @@ static int ldMode(int argc, char **argv)
args[j++] = LHFUZZ_A_PATH;
args[j++] = "-Wl,--no-whole-archive";
+ /* libcommon.a will use it when compiled with clang */
+#if defined(__clang__)
+ args[j++] = "-lBlocksRuntime";
+#endif /* defined(__clang__) */
+ args[j++] = "-lpthread";
+
return execCC(j, args);
}
