e2fsprogs does not compile properly on MacOSX and the ebuild does not list MacOSX as accepted keywords. More comments with the attached patch.
Created attachment 186307 [details, diff] Patch to make e2fsprogs 1.40.9, 1.40.11 and 1.41.4 work on MacOSX. This patch fixes the mentioned bug issues. The modifications themselves have been used with 1.40.8 now for a year and I encountered no problems. The patch has been marked "OK" only for ~x86-macos, since I have no means to test it on PPC. I didn't fully comprehend what this "GROUP" mechanism does and considered it as a GNU Linker feature that is not available on MacOSX. Hence my replacement with symllinks. All three versions crash on MacOSX with a segmentation fault in assembly code supporting some bit operations. Defining the symbol _EXT2_USE_C_VERSIONS_ activates C methods instead that work. In src_install() the ebuild refers to .so files when operating on libraries. The section is moving dynamically linked libraries into /lib, while leaving the statically linked ones in /usr/lib. For 1.40.* I changed the .so to .dylib. For 1.41 I had all the libraries installed in /lib and then moved the static ones into /usr/lib. That had the advantage of not having to change the -install_name of them and also removes any code from the ebuild that has to distinguish .so and .dylib. Both modifications work interchangeably. For the mntent.patch: e2fsprogs is using a GNU libc specific operation: setmntent and endmntent. Both operate on /etc/mtab, which doesn't exist on MacOSX, thus they are simply not called on Darwin.
Thanks a lot! I only patched and keyworded the latest ebuild. The GROUP thing indeed is something that only works on GNU linker scripts, which the Darwin linker doesn't understand. gen_usr_ldscript which does this in an eclass, actually creates a symlink for darwin, and fixes up the install_name, so little to no changes are needed in the ebuild, and Portage fixes up everything itself. I used my submitted Makefile patch from e2fsprogs-libs instead of yours, since it deals with library versioning as well. I added your getmnt patch. The ASM code seems to work on PPC, so I switched the C-code implementation only for Intel Macs. I hope I didn't break anything in the transition. Thanks a lot again!