diff --git a/src/main.cpp b/src/main.cpp index c605940d..904846f1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -872,9 +872,6 @@ static int do_option(int optc, const char *arg) case 677: opt->o_unix.force_pie = true; break; - case 678: - opt->o_unix.assume_execute_permission = true; - break; case '\0': return -1; @@ -1027,7 +1024,6 @@ static const struct mfx_option longopts[] = {"preserve-build-id", 0, 0, 675}, {"android-shlib", 0, 0, 676}, {"force-pie", 0, 0, 677}, - {"assume-execute-permission", 0, 0, 678}, // watcom/le {"le", 0x10, 0, 620}, // produce LE output // win32/pe diff --git a/src/options.h b/src/options.h index f15ffa71..267a415d 100644 --- a/src/options.h +++ b/src/options.h @@ -148,7 +148,6 @@ struct options_t { bool preserve_build_id; // copy the build-id to the compressed binary bool android_shlib; // keep some ElfXX_Shdr for dlopen() bool force_pie; // choose DF_1_PIE instead of is_shlib - bool assume_execute_permission; // do not check .st_mode for S_IXUSR } o_unix; struct { bool le; diff --git a/src/p_unix.cpp b/src/p_unix.cpp index ac31ee84..ccecb0cd 100644 --- a/src/p_unix.cpp +++ b/src/p_unix.cpp @@ -68,10 +68,11 @@ bool PackUnix::canPack() if (exetype == 0) return false; +#if defined(__unix__) && !defined(__MSYS2__) // must be executable by owner - if (!opt->o_unix.assume_execute_permission // benefits __MSYS2__ - && (fi->st.st_mode & S_IXUSR) == 0) + if ((fi->st.st_mode & S_IXUSR) == 0) throwCantPack("file not executable; try 'chmod +x'"); +#endif if (file_size < 4096) throwCantPack("file is too small");