From 765e7f35af7e4358573868389d4ea144eacd6b7a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 30 Apr 2015 02:20:36 -0700 Subject: [PATCH] linux-beagleboard-3.8: Make it compile with gcc-5 This set completes the build/compile successfully for bbb Signed-off-by: Khem Raj --- ...n-inline-use-for-gcc-4.3-in-c99-mode.patch | 36 +++++ ...-use-static-inline-instead-of-inline.patch | 35 +++++ ...u-Remove-extern-as-it-is-defined-but.patch | 130 ++++++++++++++++++ .../linux/linux-beagleboard_3.8.bb | 3 + 4 files changed, 204 insertions(+) create mode 100644 common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Fix-extern-inline-use-for-gcc-4.3-in-c99-mode.patch create mode 100644 common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Input-sentelic-use-static-inline-instead-of-inline.patch create mode 100644 common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Staging-rtl8188eu-Remove-extern-as-it-is-defined-but.patch diff --git a/common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Fix-extern-inline-use-for-gcc-4.3-in-c99-mode.patch b/common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Fix-extern-inline-use-for-gcc-4.3-in-c99-mode.patch new file mode 100644 index 00000000..1f98b6be --- /dev/null +++ b/common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Fix-extern-inline-use-for-gcc-4.3-in-c99-mode.patch @@ -0,0 +1,36 @@ +From 74196d452a593f9aab375dd4887dac0fdca519e8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 30 Apr 2015 01:47:00 -0700 +Subject: [PATCH] Fix extern inline use for gcc > 4.3 in c99 mode + +Signed-off-by: Khem Raj +--- + lib/mpi/mpi-inline.h | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/lib/mpi/mpi-inline.h b/lib/mpi/mpi-inline.h +index e2b3985..541e83a 100644 +--- a/lib/mpi/mpi-inline.h ++++ b/lib/mpi/mpi-inline.h +@@ -29,8 +29,17 @@ + #ifndef G10_MPI_INLINE_H + #define G10_MPI_INLINE_H + ++/* Starting with gcc 4.3 "extern inline" conforms in c99 mode to the ++ * c99 semantics. To keep the useful old semantics we use an ++ * attribute. ++ */ ++ + #ifndef G10_MPI_INLINE_DECL +-#define G10_MPI_INLINE_DECL extern inline ++#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ ++#define G10_MPI_INLINE_DECL extern inline __attribute__ ((__gnu_inline__)) ++#else ++#define G10_MPI_INLINE_DECL extern inline ++#endif + #endif + + G10_MPI_INLINE_DECL mpi_limb_t +-- +2.1.4 + diff --git a/common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Input-sentelic-use-static-inline-instead-of-inline.patch b/common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Input-sentelic-use-static-inline-instead-of-inline.patch new file mode 100644 index 00000000..03620ade --- /dev/null +++ b/common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Input-sentelic-use-static-inline-instead-of-inline.patch @@ -0,0 +1,35 @@ +From 5f0bcc70b396437745fada3406853df3d35039d3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 26 Apr 2015 17:55:58 +0000 +Subject: [PATCH] Input: sentelic - use "static inline" instead of "inline" + +gcc-5 defaults to gnu11 which used c99 inline semantics +in c99 'inline' is not externally visible unlike gnu89, therefore +we use 'static inline' which has same semantics between gnu89 and c99 + +Signed-off-by: Khem Raj +--- + drivers/input/mouse/sentelic.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/input/mouse/sentelic.h b/drivers/input/mouse/sentelic.h +index aa697ec..42df9e3 100644 +--- a/drivers/input/mouse/sentelic.h ++++ b/drivers/input/mouse/sentelic.h +@@ -123,11 +123,11 @@ struct fsp_data { + extern int fsp_detect(struct psmouse *psmouse, bool set_properties); + extern int fsp_init(struct psmouse *psmouse); + #else +-inline int fsp_detect(struct psmouse *psmouse, bool set_properties) ++static inline int fsp_detect(struct psmouse *psmouse, bool set_properties) + { + return -ENOSYS; + } +-inline int fsp_init(struct psmouse *psmouse) ++static inline int fsp_init(struct psmouse *psmouse) + { + return -ENOSYS; + } +-- +2.1.4 + diff --git a/common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Staging-rtl8188eu-Remove-extern-as-it-is-defined-but.patch b/common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Staging-rtl8188eu-Remove-extern-as-it-is-defined-but.patch new file mode 100644 index 00000000..886c435c --- /dev/null +++ b/common-bsp/recipes-kernel/linux/linux-beagleboard-3.8/0001-Staging-rtl8188eu-Remove-extern-as-it-is-defined-but.patch @@ -0,0 +1,130 @@ +From 2c4b2980ae16a2d8d35f126ddb9fbcba809e2612 Mon Sep 17 00:00:00 2001 +From: Vatika Harlalka +Date: Thu, 19 Mar 2015 13:25:20 +0530 +Subject: [PATCH] Staging: rtl8188eu: Remove extern as it is defined but never + used + +RTW_WPA_VERSION is removed as is declared and defined but +never used in the code. + +Signed-off-by: Vatika Harlalka +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 1 - + drivers/staging/rtl8188eu/include/ieee80211.h | 1 - + 2 files changed, 2 deletions(-) + +Index: kernel-source/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c +=================================================================== +--- kernel-source.orig/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c ++++ kernel-source/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c +@@ -26,7 +26,6 @@ + #include + + u8 RTW_WPA_OUI_TYPE[] = { 0x00, 0x50, 0xf2, 1 }; +-u16 RTW_WPA_VERSION = 1; + u8 WPA_AUTH_KEY_MGMT_NONE[] = { 0x00, 0x50, 0xf2, 0 }; + u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X[] = { 0x00, 0x50, 0xf2, 1 }; + u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X[] = { 0x00, 0x50, 0xf2, 2 }; +Index: kernel-source/drivers/net/wireless/rtl8192cu/include/ieee80211.h +=================================================================== +--- kernel-source.orig/drivers/net/wireless/rtl8192cu/include/ieee80211.h ++++ kernel-source/drivers/net/wireless/rtl8192cu/include/ieee80211.h +@@ -137,7 +137,6 @@ enum { + + #define WPA_SELECTOR_LEN 4 + extern u8 RTW_WPA_OUI_TYPE[] ; +-extern u16 RTW_WPA_VERSION ; + extern u8 WPA_AUTH_KEY_MGMT_NONE[]; + extern u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X[]; + extern u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X[]; +@@ -1194,18 +1193,18 @@ enum ieee80211_state { + (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ + (((Addr[5]) & 0xff) == 0xff)) + #else +-extern __inline int is_multicast_mac_addr(const u8 *addr) ++static inline int is_multicast_mac_addr(const u8 *addr) + { + return ((addr[0] != 0xff) && (0x01 & addr[0])); + } + +-extern __inline int is_broadcast_mac_addr(const u8 *addr) ++static inline int is_broadcast_mac_addr(const u8 *addr) + { + return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ + (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); + } + +-extern __inline int is_zero_mac_addr(const u8 *addr) ++static inline int is_zero_mac_addr(const u8 *addr) + { + return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ + (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); +Index: kernel-source/drivers/staging/rtl8192u/ieee80211/ieee80211.h +=================================================================== +--- kernel-source.orig/drivers/staging/rtl8192u/ieee80211/ieee80211.h ++++ kernel-source/drivers/staging/rtl8192u/ieee80211/ieee80211.h +@@ -2254,7 +2254,7 @@ static inline void *ieee80211_priv(struc + return ((struct ieee80211_device *)netdev_priv(dev))->priv; + } + +-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) ++static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) + { + /* Single white space is for Linksys APs */ + if (essid_len == 1 && essid[0] == ' ') +@@ -2270,7 +2270,7 @@ extern inline int ieee80211_is_empty_ess + return 1; + } + +-extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) ++static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) + { + /* + * It is possible for both access points and our device to support +@@ -2296,7 +2296,7 @@ extern inline int ieee80211_is_valid_mod + return 0; + } + +-extern inline int ieee80211_get_hdrlen(u16 fc) ++static inline int ieee80211_get_hdrlen(u16 fc) + { + int hdrlen = IEEE80211_3ADDR_LEN; + +@@ -2582,12 +2582,12 @@ void ieee80211_softmac_scan_syncro(struc + + extern const long ieee80211_wlan_frequencies[]; + +-extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) ++static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) + { + ieee->scans++; + } + +-extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) ++static inline int ieee80211_get_scans(struct ieee80211_device *ieee) + { + return ieee->scans; + } +Index: kernel-source/drivers/staging/rtl8712/ieee80211.h +=================================================================== +--- kernel-source.orig/drivers/staging/rtl8712/ieee80211.h ++++ kernel-source/drivers/staging/rtl8712/ieee80211.h +@@ -734,7 +734,7 @@ enum ieee80211_state { + #define IEEE_G (1<<2) + #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) + +-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) ++static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) + { + /* Single white space is for Linksys APs */ + if (essid_len == 1 && essid[0] == ' ') +@@ -748,7 +748,7 @@ extern inline int ieee80211_is_empty_ess + return 1; + } + +-extern inline int ieee80211_get_hdrlen(u16 fc) ++static inline int ieee80211_get_hdrlen(u16 fc) + { + int hdrlen = 24; + diff --git a/common-bsp/recipes-kernel/linux/linux-beagleboard_3.8.bb b/common-bsp/recipes-kernel/linux/linux-beagleboard_3.8.bb index 0a17a9eb..e7a1174c 100644 --- a/common-bsp/recipes-kernel/linux/linux-beagleboard_3.8.bb +++ b/common-bsp/recipes-kernel/linux/linux-beagleboard_3.8.bb @@ -41,6 +41,9 @@ SRC_URI += " \ file://0001-kernel-add-support-for-gcc-5.patch \ file://0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch \ file://0001-Input-lifebook-use-static-inline-instead-of-inline-i.patch \ + file://0001-Input-sentelic-use-static-inline-instead-of-inline.patch \ + file://0001-Staging-rtl8188eu-Remove-extern-as-it-is-defined-but.patch \ + file://0001-Fix-extern-inline-use-for-gcc-4.3-in-c99-mode.patch \ file://defconfig \ file://am335x-pm-firmware.bin \ file://logo_linux_clut224.ppm \