Commits


9l: xlc_r automatically adds -lpthread.


lib9: use __builtin_return_address on IBM XL/C


rc: avoid problematic internal names "var", "thread" For AIX.


acme: avoid global named "class" For AIX.


libdiskfs: avoid problematic internal constant names AIX defines some of these constants in its C header files.


diff: rename class to fix AIX math.h defines a function named class on AIX.


devdraw: use indirect impl interface in x11


lib9: avoid unportable use of d_namlen in dirread Fixes #395.


devdraw: use global drawlk instead of per-client Setting up for a real window system.


devdraw: use indirect impl interface Setting up for a real window system.


libthread: handle spurious _procsleep wakeups, fix $LIBTHREAD handling


libthread: add pthreadperthread mode and use under ASAN ASAN can't deal with the coroutine stacks. In theory we can call into ASAN runtime to let it know about them, but ASAN still has problems with fork or exit happening from a non-system stack. Bypass all possible problems by just having a full OS thread for each libthread thread. The threads are still cooperatively scheduled within a proc (in thos mode, a group of OS threads). Setting the environment variable LIBTHREAD=pthreadperthread will enable the pthreadperthread mode, as will building with CC9FLAGS='-fsanitize=address' in $PLAN9/config. This solution is much more general than ASAN - for example if you are trying to find all the thread stacks in a reproducible crash you can use pthreadperthread mode with any debugger that knows only about OS threads.


INSTALL: build mk all the time If mk gets into a bad state, it's not obvious that you can remove the binary to force the rebuild. Also, not rebuilding means that bugs in mkmk.sh are not noticed. Just rebuild from scratch every time. It doesn't take too long compared to the rest of INSTALL.


9c, 9l: accept CC9FLAGS from config Also, if CC9FLAGS includes -fsanitize=address (ASAN), predefine PLAN9PORT_ASAN for use by programs that need to know (mainly libthread). The 9c script used to have a variable called ngflags, which was ccflags except -g (ng stood for "no g"), but nothing needs it split out anymore, so simplify to just ccflags.


mk: replace overlapping strcpy with memmove Found by ASAN.