summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/gold/gold.cc
diff options
context:
space:
mode:
authorHan Shen <shenhan@google.com>2015-11-20 22:02:29 (GMT)
committerHan Shen <shenhan@google.com>2015-11-21 00:36:37 (GMT)
commitadb604a3879cdd7789204206d50ae2782d2538d9 (patch)
treede39c7a5039c0b956638f566ac02e715a2830783 /binutils-2.25/gold/gold.cc
parent8bfb6b2bf11cfbc445239158ec28d0988f8fa947 (diff)
downloadtoolchain_binutils-adb604a3879cdd7789204206d50ae2782d2538d9.zip
toolchain_binutils-adb604a3879cdd7789204206d50ae2782d2538d9.tar.gz
toolchain_binutils-adb604a3879cdd7789204206d50ae2782d2538d9.tar.bz2
Fix darwin build failures (because of compilation warnings).
"%ld" is the printf specifier for "long int", which is 64-bit on 64-bit machines, and 32-bit on 32-bit hosts. While uint64_t is always 64 bits, so replace it with macro "PRIu64". Tested: ./build.py --host "linux" --toolchain aarch64-linux-android ./build.py --host "linux" --toolchain arm-linux-androideabi ./build.py --host "linux" --toolchain mipsel-linux-android ./build.py --host "windows" --toolchain arm-linux-androideabi Change-Id: I9f0b322ed14e6feb7a110bfebcff963cf94d7703
Diffstat (limited to 'binutils-2.25/gold/gold.cc')
-rw-r--r--binutils-2.25/gold/gold.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/binutils-2.25/gold/gold.cc b/binutils-2.25/gold/gold.cc
index eccbc58..b278b3c 100644
--- a/binutils-2.25/gold/gold.cc
+++ b/binutils-2.25/gold/gold.cc
@@ -25,6 +25,9 @@
#include <cstdlib>
#include <cstdio>
#include <cstring>
+// __STDC_FORMAT_MACROS is needed to turn on macros in inttypes.h.
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
#include <unistd.h>
#include <algorithm>
#include "libiberty.h"
@@ -597,9 +600,11 @@ queue_middle_tasks(const General_options& options,
// perfectly and warn. So, this is fine.
if (segment_size >= target->max_pie_data_segment_size())
{
- gold_info(_("The data segment size (%ld > %ld) is likely unsafe and"
- " PIE has been disabled for this link. See go/unsafe-pie."),
- segment_size, target->max_pie_data_segment_size());
+ gold_info(
+ _("The data segment size (%" PRIu64 " > %" PRIu64 ") is likely unsafe and"
+ " PIE has been disabled for this link. See go/unsafe-pie."),
+ segment_size,
+ target->max_pie_data_segment_size());
const_cast<General_options*>(&parameters->options())->set_pie_value(false);
}
}