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

Cannot build on cygwin: ‘SA_ONSTACK’ undeclared #232

Closed
marcintustin opened this issue Dec 4, 2011 · 7 comments
Closed

Cannot build on cygwin: ‘SA_ONSTACK’ undeclared #232

marcintustin opened this issue Dec 4, 2011 · 7 comments

Comments

@marcintustin
Copy link

I'm trying to build using the 2.4.4 release on cygwin, using the unaltered makefiles. Compilation fails with:

$ make
cd src && make all
make[1]: Entering directory `/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/src'
MAKE hiredis
make[2]: Entering directory `/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/deps/hiredis'
make[2]: Nothing to be done for `static'.
make[2]: Leaving directory `/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/deps/hiredis'
MAKE linenoise
make[2]: Entering directory `/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/deps/linenoise'
make[2]: `linenoise_example' is up to date.
make[2]: Leaving directory `/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/deps/linenoise'
MAKE hiredis
make[2]: Entering directory `/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/deps/hiredis'
make[2]: Nothing to be done for `static'.
make[2]: Leaving directory `/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/deps/hiredis'
LINK redis-benchmark
cc: unrecognized option '-rdynamic'
cc: unrecognized option '-pthread'
LINK redis-cli
cc: unrecognized option '-rdynamic'
cc: unrecognized option '-pthread'
CC redis.o
cc: unrecognized option '-rdynamic'
redis.c: In function �±dictSdsKeyCaseCompare�²:
redis.c:274:5: warning: implicit declaration of function �±strcasecmp�²
redis.c: In function �±setupSignalHandlers�²:
redis.c:1794:33: error: �±SA_ONSTACK�² undeclared (first use in this function)
redis.c:1794:33: note: each undeclared identifier is reported only once for each function it appears in
Makefile:193: recipe for target `redis.o' failed
make[1]: *** [redis.o] Error 1
make[1]: Leaving directory `/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/src'
Makefile:6: recipe for target `all' failed
make: *** [all] Error 2
@antirez
Copy link
Contributor

antirez commented Dec 5, 2011

I think something like that is needed:

#ifdef __CYGWIN__
#ifndef SA_ONSTACK
#define SA_ONSTACK 0x08000000
#endif
#endif

Please can you try if this works for you?

(Credits: the above patch was provided by @noelherrick on twitter)

@jackywyz
Copy link

The patch is ok for me in cygwin.

@shahamit
Copy link

I am new to cygwin. What are the steps to be followed to apply this patch? for e.g. Do I need to create a new file which have the above lines of code etc?

@pfarrell
Copy link

pfarrell commented Sep 7, 2012

The patch worked for me too.

For web searchers in the future, I added the patch after the last #define in src/redis.h (for me, this was at line 244 when I patched it).

https://gist.github.com/3668350

@amit-paradkar
Copy link

Thanks! The solution worked.

But now seeing issues while running test. I think the faster solution would be to move to unix based env.

@mseravalli
Copy link

antirez solution worked for me as well
thanks

@zhuxn1987
Copy link

Mark..The solution worked.

mattsta added a commit to mattsta/redis that referenced this issue May 12, 2014
@mattsta mattsta closed this as completed in 3e0e51d Jun 9, 2014
mattsta added a commit that referenced this issue Jun 9, 2014
mattsta added a commit that referenced this issue Jun 9, 2014
PatKamin added a commit to PatKamin/redis that referenced this issue Oct 28, 2022
[6.0.10] Add compile and linking security flags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants