Commit 14881342 authored by Laurent Dufour's avatar Laurent Dufour Committed by Andrei Vagin

compel: fix build break on ppc64le

This patch fix a build break on ppc64le introduced by changes in the
compel's build option.

I factorized the common CFLAGS to make easier identifying particular
flags required by some architectures.

Fixes: fef01d79f7ee ("compel: cli -- Add more flags into cflags report")
travis-ci: success for compel: fix build break on ppc64le
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 429da903
...@@ -15,15 +15,15 @@ ...@@ -15,15 +15,15 @@
#include "version.h" #include "version.h"
#include "piegen.h" #include "piegen.h"
static const char compel_cflags_pie[] = #define CFLAGS_DEFAULT_SET \
"-fpie -Wstrict-prototypes -Wa,--noexecstack " "-Wstrict-prototypes -Wa,--noexecstack " \
"-fno-stack-protector -fno-jump-tables -nostdlib " "-fno-stack-protector -nostdlib -fomit-frame-pointer "
"-fomit-frame-pointer";
static const char compel_cflags_nopic[] = #define COMPEL_CFLAGS_PIE CFLAGS_DEFAULT_SET "-fpie -fno-jump-tables"
"-fno-pic -Wstrict-prototypes -Wa,--noexecstack " #define COMPEL_CFLAGS_PIE_JPT CFLAGS_DEFAULT_SET "-fpie"
"-fno-stack-protector -fno-jump-tables -nostdlib " #define COMPEL_CFLAGS_NOPIC CFLAGS_DEFAULT_SET "-fno-pic -fno-jump-tables"
"-fomit-frame-pointer";
static const char compel_ldflags[] = "-r"; #define COMPEL_LDFLAGS_DEFAULT "-r"
piegen_opt_t opts = { piegen_opt_t opts = {
.input_filename = NULL, .input_filename = NULL,
...@@ -99,19 +99,19 @@ int main(int argc, char *argv[]) ...@@ -99,19 +99,19 @@ int main(int argc, char *argv[])
static const compel_cflags_t compel_cflags[] = { static const compel_cflags_t compel_cflags[] = {
{ {
.arch = "x86", .arch = "x86",
.cflags = compel_cflags_pie, .cflags = COMPEL_CFLAGS_PIE,
}, { }, {
.arch = "ia32", .arch = "ia32",
.cflags = compel_cflags_nopic, .cflags = COMPEL_CFLAGS_NOPIC,
}, { }, {
.arch = "aarch64", .arch = "aarch64",
.cflags = compel_cflags_pie, .cflags = COMPEL_CFLAGS_PIE,
}, { }, {
.arch = "arm", .arch = "arm",
.cflags = compel_cflags_pie, .cflags = COMPEL_CFLAGS_PIE,
}, { }, {
.arch = "ppc64", .arch = "ppc64",
.cflags = compel_cflags_pie, .cflags = COMPEL_CFLAGS_PIE_JPT,
}, },
}; };
...@@ -190,7 +190,7 @@ int main(int argc, char *argv[]) ...@@ -190,7 +190,7 @@ int main(int argc, char *argv[])
} }
if (!strcmp(action, "ldflags")) { if (!strcmp(action, "ldflags")) {
printf("%s", compel_ldflags); printf("%s", COMPEL_LDFLAGS_DEFAULT);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment