Index: makefile ================================================================== --- makefile +++ makefile @@ -16,15 +16,15 @@ # converters ctl: nkvd.so bgrd # manipulating disobedient software nkvd.so: nkvd.c - $(CC) -fPIC -pie $< -o$@ -Wl,-E -ldl $(nkvd-flags) + $(CC) -fPIC -pie -shared $< -o$@ -Wl,-E -ldl $(nkvd-flags) bgrd: bgrd.c $(cc) $< -lutil -o$@ $(cc-post) safekill: safekill.c $(cc) $< -lX11 -o$@ $(cc-post) xpriv: xpriv.c $(cc) $< -lrt -lutil -lX11 -o $@ $(cc-post) Index: nkvd.c ================================================================== --- nkvd.c +++ nkvd.c @@ -1,9 +1,9 @@ /* [ʞ] nkvd.c - XDG directory enforcer * ~ lexi hale * © AGPLv3 - * $ cc -fPIC -pie nkvd.c -Wl,-E -onkvd -ldl + * $ cc -fPIC -pie -shared nkvd.c -Wl,-E -onkvd -ldl * [-D_NO_GNU [-D_LIBC=…]] [-D_CONF_HOME=…] * $ export LD_PRELOAD=nkvd.so * * ! NOTE: for unknown reasons, nkvd currently only works * when built without optimizations. it's probably that @@ -13,11 +13,11 @@ * this bug affects other compilers. * - bizarre complication: the bug can only be reproduced * if the -O flag itself is present; turning on the * same individual optimization flags that -O is * supposed to represent does not trigger the problem. - * - conclusion: compiler devils. + * - conclusion: compiler devils * * ! WARNING: test this program thoroughly before you start * exporting it from your shellrcs; if things get fucked, * you may not be able to execute any binaries with the * variable set, and will need to log in as root or boot @@ -136,20 +136,18 @@ # define SYMSRC hnd # endif #endif #include #include -#include #ifndef _LIBC # define _LIBC "libc.so.6" #endif #ifndef _CONF_HOME # define _CONF_HOME ".config" #endif - #define pstr(x) x,sizeof x #define hl(txt) "\x1b[1;31m" txt "\x1b[m" #define bold(txt) "\x1b[1m" txt "\x1b[21m" #define e_fatal hl("(nkvd fatal)") " "