summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Ribeiro <mauro.ribeiro@hardkernel.com>2018-02-20 21:30:32 +0300
committerGitHub <noreply@github.com>2018-02-20 21:30:32 +0300
commit95264d19d04930f67f10f162df70de447659329d (patch)
tree00cf90ba7f9b2c4b877ca0d3c3b9ad76b90495a8
parent2e4380b16e671c2822343ad17aac318d4c6e539b (diff)
parentecc37a0f8ac8a08ecf63b0df1c34f26317bcbc69 (diff)
downloadu-boot-95264d19d04930f67f10f162df70de447659329d.tar.xz
Fix cross builds and using gcc-7+
-rw-r--r--arch/arm/cpu/armv8/gxb/bl31_apis.c4
-rw-r--r--drivers/gpio/Makefile2
-rw-r--r--drivers/mmc/aml_sd_emmc.c2
-rw-r--r--drivers/usb/gadget/s3c_udc_otg.c2
-rw-r--r--include/linux/compiler-gcc7.h66
-rw-r--r--tools/fip_create/Makefile9
6 files changed, 75 insertions, 10 deletions
diff --git a/arch/arm/cpu/armv8/gxb/bl31_apis.c b/arch/arm/cpu/armv8/gxb/bl31_apis.c
index 992742b5bc..1939c1d620 100644
--- a/arch/arm/cpu/armv8/gxb/bl31_apis.c
+++ b/arch/arm/cpu/armv8/gxb/bl31_apis.c
@@ -62,7 +62,7 @@ int32_t meson_trustzone_efuse(struct efuse_hal_api_arg *arg)
if (arg->cmd == EFUSE_HAL_API_WRITE)
memcpy((void *)sharemem_input_base,
(const void *)arg->buffer_phy, size);
- asm __volatile__("" : : : "memory");
+ asm __volatile__("" : : : "memory");
register uint64_t x0 asm("x0") = cmd;
register uint64_t x1 asm("x1") = offset;
@@ -318,4 +318,4 @@ void set_usb_boot_function(unsigned long command)
"smc #0\n"
: "+r" (x0)
: "r" (x1));
-} \ No newline at end of file
+}
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 8d95da9931..b6e36db566 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -38,3 +38,5 @@ obj-$(CONFIG_TCA642X) += tca642x.o
oby-$(CONFIG_SX151X) += sx151x.o
obj-$(CONFIG_SUNXI_GPIO) += sunxi_gpio.o
obj-$(CONFIG_AML_GPIO) += amlogic_gpio.o
+
+ccflags-$(CONFIG_AML_GPIO) += $(call cc-option,-Wno-int-in-bool-context)
diff --git a/drivers/mmc/aml_sd_emmc.c b/drivers/mmc/aml_sd_emmc.c
index 86ce0091ab..cca0884e6d 100644
--- a/drivers/mmc/aml_sd_emmc.c
+++ b/drivers/mmc/aml_sd_emmc.c
@@ -241,7 +241,7 @@ static int sd_inand_staff_init(struct mmc *mmc)
}
if (!sdio->inited_flag)
sdio->inited_flag = 1;
- return SD_NO_ERROR;
+ return SD_NO_ERROR;
}
diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index e6325e2605..00be8d7593 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -62,13 +62,11 @@ static char *state_names[] = {
"WAIT_FOR_NULL_COMPLETE",
};
-#define DRIVER_DESC "S3C HS USB OTG Device Driver, (c) Samsung Electronics"
#define DRIVER_VERSION "15 March 2009"
struct s3c_udc *the_controller;
static const char driver_name[] = "s3c-udc";
-static const char driver_desc[] = DRIVER_DESC;
static const char ep0name[] = "ep0-control";
/* Max packet size*/
diff --git a/include/linux/compiler-gcc7.h b/include/linux/compiler-gcc7.h
new file mode 100644
index 0000000000..cdd1cc202d
--- /dev/null
+++ b/include/linux/compiler-gcc7.h
@@ -0,0 +1,66 @@
+#ifndef __LINUX_COMPILER_H
+#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
+#endif
+
+#define __used __attribute__((__used__))
+#define __must_check __attribute__((warn_unused_result))
+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
+
+/* Mark functions as cold. gcc will assume any path leading to a call
+ to them will be unlikely. This means a lot of manual unlikely()s
+ are unnecessary now for any paths leading to the usual suspects
+ like BUG(), printk(), panic() etc. [but let's keep them for now for
+ older compilers]
+
+ Early snapshots of gcc 4.3 don't support this and we can't detect this
+ in the preprocessor, but we can live with this because they're unreleased.
+ Maketime probing would be overkill here.
+
+ gcc also has a __attribute__((__hot__)) to move hot functions into
+ a special section, but I don't see any sense in this right now in
+ the kernel context */
+#define __cold __attribute__((__cold__))
+
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
+
+#ifndef __CHECKER__
+# define __compiletime_warning(message) __attribute__((warning(message)))
+# define __compiletime_error(message) __attribute__((error(message)))
+#endif /* __CHECKER__ */
+
+/*
+ * Mark a position in code as unreachable. This can be used to
+ * suppress control flow warnings after asm blocks that transfer
+ * control elsewhere.
+ *
+ * Early snapshots of gcc 4.5 don't support this and we can't detect
+ * this in the preprocessor, but we can live with this because they're
+ * unreleased. Really, we need to have autoconf for the kernel.
+ */
+#define unreachable() __builtin_unreachable()
+
+/* Mark a function definition as prohibited from being cloned. */
+#define __noclone __attribute__((__noclone__))
+
+/*
+ * Tell the optimizer that something else uses this function or variable.
+ */
+#define __visible __attribute__((externally_visible))
+
+/*
+ * GCC 'asm goto' miscompiles certain code sequences:
+ *
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
+ *
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
+ * Fixed in GCC 4.8.2 and later versions.
+ *
+ * (asm goto is automatically volatile - the naming reflects this.)
+ */
+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
+
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
+#define __HAVE_BUILTIN_BSWAP32__
+#define __HAVE_BUILTIN_BSWAP64__
+#define __HAVE_BUILTIN_BSWAP16__
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
diff --git a/tools/fip_create/Makefile b/tools/fip_create/Makefile
index 69569a1b2f..a065e469e7 100644
--- a/tools/fip_create/Makefile
+++ b/tools/fip_create/Makefile
@@ -42,7 +42,6 @@ endif
# could get pulled in from firmware tree.
INCLUDE_PATHS = -I.
-CC := gcc
RM := rm -rf
.PHONY: all clean
@@ -50,12 +49,12 @@ RM := rm -rf
all: ${PROJECT}
${PROJECT}: ${OBJECTS} Makefile
- @echo " LD $@"
- ${Q}${CC} ${OBJECTS} -o $@
+ @echo " HOSTLD $@"
+ ${Q}${HOSTCC} ${OBJECTS} -o $@
%.o: %.c %.h Makefile
- @echo " CC $<"
- ${Q}${CC} -c ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
+ @echo " HOSTCC $<"
+ ${Q}${HOSTCC} -c ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
clean:
${Q}${RM} ${PROJECT}