From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yong Liu Subject: [PATCH] fix build warning and failure in Suse11 Date: Wed, 18 Mar 2015 15:10:41 +0800 Message-ID: <1426662641-24781-1-git-send-email-yong.liu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable To: dev-VfR2kkLFssw@public.gmane.org Return-path: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Suse11 SP3 default gcc version is 4.3.4, some options not support on this= version. error: implicit declaration of function =E2=80=98_mm_alignr_epi8=E2=80=99 solution: include tmmintrin.h when enable SSE3 error: unrecognized command line option "-Wno-unused-but-set-variable" solution: add version check in fm10k Makefile error: enic_main.c:845: error: initialized field overwritten solution: change struct initialization code error: =E2=80=98testfn_pci_cmd=E2=80=99 defined but not used solution: add __attribute__((unused)) before function definition error: unrecognized command line option "-fno-var-tracking-assignments" solution: add version check in app/test/Makefile error: implicit declaration of function =E2=80=98pread=E2=80=99 solution: add _GNU_SOURCE flag when compile eal_pci_uio and eal_interrupt= s signed-off-by: Marvin Liu diff --git a/app/test/Makefile b/app/test/Makefile index 9f0262c..4aca77c 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -152,9 +152,11 @@ CFLAGS +=3D -D_GNU_SOURCE =20 # Disable VTA for memcpy test ifeq ($(CC), gcc) +ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) CFLAGS_test_memcpy.o +=3D -fno-var-tracking-assignments CFLAGS_test_memcpy_perf.o +=3D -fno-var-tracking-assignments endif +endif =20 # this application needs libraries first DEPDIRS-y +=3D lib diff --git a/app/test/test.h b/app/test/test.h index 5450986..13f6592 100644 --- a/app/test/test.h +++ b/app/test/test.h @@ -169,7 +169,7 @@ struct test_command { void add_test_command(struct test_command *t); =20 #define REGISTER_TEST_COMMAND(t) \ -static void testfn_##t(void);\ +static void __attribute__((unused))testfn_##t(void);\ void __attribute__((constructor, used)) testfn_##t(void)\ {\ add_test_command(&t);\ diff --git a/lib/librte_eal/common/include/rte_common_vect.h b/lib/librte= _eal/common/include/rte_common_vect.h index 54ec70f..df3dce4 100644 --- a/lib/librte_eal/common/include/rte_common_vect.h +++ b/lib/librte_eal/common/include/rte_common_vect.h @@ -50,6 +50,10 @@ #include #endif =20 +#ifdef __SSE3__ +#include +#endif + #if defined(__SSE4_2__) || defined(__SSE4_1__) #include #endif diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxa= pp/eal/Makefile index 23c2d48..21875b8 100644 --- a/lib/librte_eal/linuxapp/eal/Makefile +++ b/lib/librte_eal/linuxapp/eal/Makefile @@ -102,6 +102,8 @@ CFLAGS_eal_pci_vfio.o :=3D -D_GNU_SOURCE CFLAGS_eal_common_whitelist.o :=3D -D_GNU_SOURCE CFLAGS_eal_common_options.o :=3D -D_GNU_SOURCE CFLAGS_eal_common_thread.o :=3D -D_GNU_SOURCE +CFLAGS_eal_pci_uio.o :=3D -D_GNU_SOURCE +CFLAGS_eal_interrupts.o :=3D -D_GNU_SOURCE =20 # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D12603 diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_m= ain.c index c66f139..0892b3e 100644 --- a/lib/librte_pmd_enic/enic_main.c +++ b/lib/librte_pmd_enic/enic_main.c @@ -840,10 +840,12 @@ static int enic_set_rsskey(struct enic *enic) dma_addr_t rss_key_buf_pa; union vnic_rss_key *rss_key_buf_va =3D NULL; static union vnic_rss_key rss_key =3D { - .key[0] =3D {.b =3D {85, 67, 83, 97, 119, 101, 115, 111, 109, 101}}, - .key[1] =3D {.b =3D {80, 65, 76, 79, 117, 110, 105, 113, 117, 101}}, - .key[2] =3D {.b =3D {76, 73, 78, 85, 88, 114, 111, 99, 107, 115}}, - .key[3] =3D {.b =3D {69, 78, 73, 67, 105, 115, 99, 111, 111, 108}}, + .key =3D { + [0] =3D {.b =3D {85, 67, 83, 97, 119, 101, 115, 111, 109, 101}}, + [1] =3D {.b =3D {80, 65, 76, 79, 117, 110, 105, 113, 117, 101}}, + [2] =3D {.b =3D {76, 73, 78, 85, 88, 114, 111, 99, 107, 115}}, + [3] =3D {.b =3D {69, 78, 73, 67, 105, 115, 99, 111, 111, 108}}, + } }; int err; u8 name[NAME_MAX]; diff --git a/lib/librte_pmd_fm10k/Makefile b/lib/librte_pmd_fm10k/Makefil= e index 998bf23..52fc315 100644 --- a/lib/librte_pmd_fm10k/Makefile +++ b/lib/librte_pmd_fm10k/Makefile @@ -62,13 +62,18 @@ else # # CFLAGS for gcc # -ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) -CFLAGS +=3D -Wno-deprecated -endif CFLAGS_BASE_DRIVER =3D -Wno-unused-parameter -Wno-unused-value CFLAGS_BASE_DRIVER +=3D -Wno-strict-aliasing -Wno-format-extra-args -CFLAGS_BASE_DRIVER +=3D -Wno-unused-variable -Wno-unused-but-set-variabl= e +CFLAGS_BASE_DRIVER +=3D -Wno-unused-variable CFLAGS_BASE_DRIVER +=3D -Wno-missing-field-initializers + +ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) +CFLAGS +=3D -Wno-deprecated +endif + +ifeq ($(shell test $(GCC_VERSION) -ge 46 && echo 1), 1) +CFLAGS_BASE_DRIVER +=3D -Wno-unused-but-set-variable +endif endif =20 # --=20 1.9.3