From 20c9d412716d945c7bfd2efdc90e57931bc1cfd2 Mon Sep 17 00:00:00 2001 From: Matthew Kilgore Date: Sat, 27 Aug 2022 00:17:09 -0400 Subject: [PATCH] Use -no-pie on Linux The -no-pie flag tells the compiler not to make a Position Independent Executable. We don't really care which it chooses to make, but some file explorers consider PIE executables to be shared objects and won't allow you to run them directly. To avoid this, we're compiling with -no-pie. Fixes: #142 --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 4f965a12e..b483a2cef 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,10 @@ ifeq ($(OS),lnx) PLATFORM := posix EXTENSION := + # Compiling with -no-pie lets some file explorers know we're an executable, + # not a shared object + CXXFLAGS += -no-pie + # Check bitness by getting length of `long # 64 bits on x86_64, 32 bits on x86 BITS := $(shell getconf LONG_BIT)