You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
745 B

Add fixes for debug builds (#2296) * build-package.sh: add possibility for debug patches and TERMUX_PKG_HAS_DEBUG Setting TERMUX_PKG_HAS_DEBUG=no disables attempt to build debug build of package. Useful for example if a debug build doesn't make sense, as for python-packages and texlive. * aapt: skip D_FORTIFY_SOURCE=2 for libandroid-cutils when doing debug build * lftp: skip D_FORTIFY_SOURCE=2 for debug build * libflac: don't use -g3 for debug build Configure script removes it otherwise. * nano: skip -D_FORTIFY_SOURCE=2 for debug build * vifm: skip -D_FORTIFY_SOURCE=2 for debug build * mc: skip -D_FORTIFY_SOURCE=2 for debug build * dropbear: add __attribute__((overloadable)) to XMEMSET and XMEMCPY if debug * gdb: add __attribute__((overloadable)) to strchr if debug * gnuit: add __attribute__((overloadable)) to strchr and strcpy if debug * gperf: add __attribute__((overloadable)) to strlen if debug * inetutils: add __attribute__((overloadable)) to strrchr and strchr if debug * readline: add __attribute__((overloadable)) to strchr if debug * tsocks: add __attribute__((overloadable)) to poll if debug * units: add __attribute__((overloadable)) to strchr if debug * liblua: fix bug in loslib.c that emerged in debug build Use strncpy instead of strcpy. Original error message: loslib.c:169:3: error: 'strcpy' called with string bigger than buffer lua_tmpnam(buff, err); ^ loslib.c:122:37: note: expanded from macro 'lua_tmpnam' strcpy(b, LUA_TMPNAMTEMPLATE); \ ^ * alpine: include our getpass.h in imap's mtest.c to declare getpass Debug build complained about the previous implicit declaration. * nginx: use --with-debug instead of --debug * cboard: skip -D_FORTIFY_SOURCE=2 for debug build * gettext: add __attribute__((overloadable)) to getcwd if debug * oathtool: skip -D_FORTIFY_SOURCE=2 for debug build * php: add __attribute__((overloadable)) to strlcpy and strlcat if debug * expect: add __attribute__((overloadable)) to strchr if debug * texlive: set TERMUX_PKG_HAS_DEBUG=no * asciinema: set TERMUX_PKG_HAS_DEBUG=no * libllvm: set TERMUX_PKG_HAS_DEBUG=no Debug build fails with: home/builder/.termux-build/libllvm/src/lib/Support/Unix/Path.inc:740:19: error: no matching function for call to 'RetryAfterSignal' if ((ResultFD = sys::RetryAfterSignal(-1, open, P.begin(), OpenFlags)) < 0) * build-package.sh: set TERMUX_PKG_REPLACES=package if debug build Hopefully allows us to install debug packages without breaking dependecies. Should be looked over and be made more similar to how debian does this in any case * Update build.sh
7 years ago
--- ./src/loslib.c 2017-11-18 15:51:35.425137997 +0000
+++ ../loslib.c 2017-11-18 16:20:36.202578294 +0000
@@ -118,8 +118,8 @@
#define LUA_TMPNAMTEMPLATE "/data/data/com.termux/files/usr/tmp/lua_XXXXXX"
#endif
-#define lua_tmpnam(b,e) { \
- strcpy(b, LUA_TMPNAMTEMPLATE); \
+#define lua_tmpnam(b,e,s) { \
+ strncpy(b, LUA_TMPNAMTEMPLATE, s); \
e = mkstemp(b); \
if (e != -1) close(e); \
e = (e == -1); }
@@ -166,7 +166,7 @@
static int os_tmpname (lua_State *L) {
char buff[LUA_TMPNAMBUFSIZE];
int err;
- lua_tmpnam(buff, err);
+ lua_tmpnam(buff, err, LUA_TMPNAMBUFSIZE - 1);
if (err)
return luaL_error(L, "unable to generate a unique filename");
lua_pushstring(L, buff);