Skip to content

Commit

Permalink
WA-Move -pie option to linker flags
Browse files Browse the repository at this point in the history
Move the -pie option from CFLAGS to LDFLAGS
to fix below build error:
clang++: error: argument unused during compilation:
'-pie' [-Werror,-Wunused-command-line-argument]

Signed-off-by: svenate <[email protected]>
Signed-off-by: Tanuj Tekriwal <[email protected]>
  • Loading branch information
SaliniVenate authored and Shao-Feng committed Feb 22, 2023
1 parent ec07079 commit 00c8eb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions android/mfx_defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ MFX_CFLAGS += \
# Security
MFX_CFLAGS += \
-fstack-protector \
-fPIE -fPIC -pie \
-fPIE -fPIC \
-O2 -D_FORTIFY_SOURCE=2 \
-Wformat -Wformat-security \
-fexceptions -frtti
Expand Down Expand Up @@ -117,7 +117,7 @@ MFX_INCLUDES_LIBVA := $(TARGET_OUT_HEADERS)/libva

# Setting usual link flags
MFX_LDFLAGS := \
-z noexecstack \
-z noexecstack -pie \
-z relro -z now

# Setting vendor
Expand Down
2 changes: 1 addition & 1 deletion builder/FindGlobals.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if( Linux OR Darwin )

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -fPIC ${c_warnings} ${no_warnings} ${common_flags}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC ${cxx_warnings} ${no_warnings} ${common_flags}")
append("-fPIE -pie" CMAKE_EXE_LINKER_FLAGS)
append("-fPIE" CMAKE_EXE_LINKER_FLAGS)

# CACHE + FORCE should be used only here to make sure that this parameters applied globally
# End user is responsible to adjust configuration parameters further if needed. Here
Expand Down

0 comments on commit 00c8eb8

Please sign in to comment.