some code cleanup related to segmented stacks
add clang support for segmented stacks