Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 263841 - e2fsprogs does not compile properly on MacOSX and crashes with a SEGFAULT
Summary: e2fsprogs does not compile properly on MacOSX and crashes with a SEGFAULT
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: x86 OS X
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-26 08:24 UTC by Dirk Tilger
Modified: 2009-03-26 11:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to make e2fsprogs 1.40.9, 1.40.11 and 1.41.4 work on MacOSX. (e2fsprogs.diff,11.94 KB, patch)
2009-03-26 08:44 UTC, Dirk Tilger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Tilger 2009-03-26 08:24:56 UTC
e2fsprogs does not compile properly on MacOSX and the ebuild does not list MacOSX as accepted keywords. More comments with the attached patch.
Comment 1 Dirk Tilger 2009-03-26 08:44:53 UTC
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.
Comment 2 Fabian Groffen gentoo-dev 2009-03-26 11:13:38 UTC
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!