Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snap linking failure on Solaris due to missing timegm function #136

Open
kgardas opened this issue Feb 9, 2015 · 4 comments
Open

snap linking failure on Solaris due to missing timegm function #136

kgardas opened this issue Feb 9, 2015 · 4 comments

Comments

@kgardas
Copy link

kgardas commented Feb 9, 2015

Hello,
an atempt to cabal install snap on Solaris 11 with GHC 7.8.3 fails with:

Linking dist/build/snap/snap ...
Undefined                       first referenced
 symbol                             in file
timegm                              /export/home/karel/.cabal/lib/i386-solaris-ghc-7.8.3/snap-core-0.9.6.4/libHSsnap-core-0.9.6.4.a(timefuncs.o)
ld: fatal: symbol referencing errors
collect2: ld returned 1 exit status
Failed to install snap-0.13.3.2
cabal: Error: some packages failed to install:
snap-0.13.3.2 failed during the building phase. The exception was:
ExitFailure 1

It looks like timegm is Linux-specific time function which is not implemented on Solaris, from timegm(3):

CONFORMING TO
       These  functions  are nonstandard GNU extensions that are also present on the BSDs.  Avoid
       their use; see NOTES.

Just reporting for the record. If Snap is applicable to my project I will surely attempt to submit proper fix.

@gregorycollins
Copy link
Member

You can install snap with -fportable which should turn off any C extensions. The offending code is here:

https://github.com/snapframework/snap-core/blob/94f676037877acf2482132fdfa1c5ec3df56a797/cbits/timefuncs.c

@kgardas
Copy link
Author

kgardas commented Feb 9, 2015

Thanks for the hint! I've already hacked there my_timegm as recommended by timegm(3). Anyway:

cabal install -fportable snap-core snap-server snap --reinstall

is also working well. So feel free to close it or do not if you like to have this open and on eyes. Hmm, perhaps edit and addition of currently supported flags to https://hackage.haskell.org/package/snap -- should be enough? I've quickly scanned over faq and some doc and have not been able to find -fportable there nor on the hackage page.

@gregorycollins
Copy link
Member

For performance reasons it would be preferable if the C code were CPP'd to work correctly; portable mode chooses slower alternatives for many common operations.

The "portable" flag is for snap-core and snap-server, which is why you didn't see it at the snap package; probably we should mention it there as well.

@kgardas
Copy link
Author

kgardas commented Feb 9, 2015

I'll see if I may provide some timegm for Solaris. Anyway, you should note all the flags on snap package page too since you recommend it as quick install way on http://snapframework.com/download -- and I used that "cabal install snap" in a hope this will solve all the dependency too. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants