diff options
| -rw-r--r-- | meta-oe/recipes-benchmark/libhugetlbfs/files/libhugetlbfs-avoid-using-restrict-as-var-name.patch | 34 | ||||
| -rw-r--r-- | meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/files/libhugetlbfs-avoid-using-restrict-as-var-name.patch b/meta-oe/recipes-benchmark/libhugetlbfs/files/libhugetlbfs-avoid-using-restrict-as-var-name.patch new file mode 100644 index 0000000000..b77cfe10e0 --- /dev/null +++ b/meta-oe/recipes-benchmark/libhugetlbfs/files/libhugetlbfs-avoid-using-restrict-as-var-name.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | Avoid using keyword restrict as variable name which causes error with gcc 5.x: | ||
| 2 | |||
| 3 | | hugeutils.c: In function '__lh_hugetlbfs_setup_env': | ||
| 4 | | hugeutils.c:304:40: error: expected identifier or '(' before 'restrict' | ||
| 5 | | char *p, *tok, *exe, buf[MAX_EXE+1], restrict[MAX_EXE]; | ||
| 6 | | ^ | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
| 11 | --- | ||
| 12 | diff --git a/hugeutils.c b/hugeutils.c | ||
| 13 | index 53a7fbd..b9d7001 100644 | ||
| 14 | --- a/hugeutils.c | ||
| 15 | +++ b/hugeutils.c | ||
| 16 | @@ -301,14 +301,14 @@ void hugetlbfs_setup_env() | ||
| 17 | |||
| 18 | env = getenv("HUGETLB_RESTRICT_EXE"); | ||
| 19 | if (env) { | ||
| 20 | - char *p, *tok, *exe, buf[MAX_EXE+1], restrict[MAX_EXE]; | ||
| 21 | + char *p, *tok, *exe, buf[MAX_EXE+1], restricted[MAX_EXE]; | ||
| 22 | int found = 0; | ||
| 23 | |||
| 24 | exe = get_exe_name(buf, sizeof buf); | ||
| 25 | DEBUG("Found HUGETLB_RESTRICT_EXE, this exe is \"%s\"\n", exe); | ||
| 26 | - strncpy(restrict, env, sizeof restrict); | ||
| 27 | - restrict[sizeof(restrict)-1] = 0; | ||
| 28 | - for (p = restrict; (tok = strtok(p, ":")) != NULL; p = NULL) { | ||
| 29 | + strncpy(restricted, env, sizeof restricted); | ||
| 30 | + restricted[sizeof(restricted)-1] = 0; | ||
| 31 | + for (p = restricted; (tok = strtok(p, ":")) != NULL; p = NULL) { | ||
| 32 | DEBUG(" ...check exe match for \"%s\"\n", tok); | ||
| 33 | if (strcmp(tok, exe) == 0) { | ||
| 34 | found = 1; | ||
diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb index ae5e46a464..b7cc4162aa 100644 --- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | |||
| @@ -18,6 +18,7 @@ SRC_URI = " \ | |||
| 18 | file://tests-Makefile-install-static-4G-edge-testcases.patch \ | 18 | file://tests-Makefile-install-static-4G-edge-testcases.patch \ |
| 19 | file://0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch \ | 19 | file://0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch \ |
| 20 | file://libhugetlbfs-elf_i386-avoid-search-host-library-path.patch \ | 20 | file://libhugetlbfs-elf_i386-avoid-search-host-library-path.patch \ |
| 21 | file://libhugetlbfs-avoid-using-restrict-as-var-name.patch \ | ||
| 21 | " | 22 | " |
| 22 | 23 | ||
| 23 | S = "${WORKDIR}/git" | 24 | S = "${WORKDIR}/git" |
