-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Define _XOPEN_SOURCE appropriately on NetBSD. #824
Conversation
Define _XOPEN_SOURCE appropriately on NetBSD.
Hello, I just merged and back ported to 2.6, 2.8 braches. Thank you. About the -march, a different approach could be to switch off atomic increments and use the old mutex code when the target is forced to 32bit... Otherwise there is the generic -march=native that could also be a solution, but I wonder if this is going to create problems when compiling on a system and running on aother system with a different CPU type, even if of the same family. |
@antirez I think using -march=natvie is not a good solution about gcc 4.1.x gcc -march=native test.c
test.c:1: error: bad value (native) for -march= switch
test.c:1: error: bad value (native) for -mtune= switch and this is manual for gcc in document, you can find gcc supports -march=native from 4.2.x as you know, many IT companies still use RHEL 5.x version yet. and I'm trying to reproduce this situation now. :) |
Thanks @charsyam, maybe we could simply do... -march=486 or alike... that is more past-compatible, this should always be backward compatible unless people are using a true 386 that is no longer supported even by Linux :-) |
@antirez yes, I think it is somewhat complicated problem. that's why I sent you some wired patch. and I have a question. Do you have any plan to support like FAQ for this problem. |
@antirez and, If you want, I can write FAQ just about "build problems" , |
@antirez I reproduced it. just using rhel 5.4(32bit) and if you want i will give you a mail which contains ip and user and passwd |
@charsyam thanks and sorry for not replying early, I had a family problem that took me AFK for some time. From all your reports I see that:
At this point I believe the solution you proposed is the best: document the issue. We can write a FAQ in the documentation "compiling Redis a 32 bit Redis binary using a 64 bit system". However, what about to display a big node about the issues it is possible to encounter when "make 32bit" is performed, directly in the user screen? This seems like the best options we have. About "make distclean", there are multiple issues about it, what are you referring to exactly? For instance you need make distclean to build a 32 bit executable. But also, you need a make distclean if you want to change from -O2 to -O3 otherwise your switch will be ignored. Cheers and thanks for your help! |
@antirez it is not only about "compiling Redis a 32 bit Redis binary using a 64 bit system". it can also happen "compiling Redis a 32 bit Redis binary using a 32 bit system.". I sent a patch add it README file and I just mentioned about "make distclean" issue redis build. |
* Add testEscape * Add escaped quotes
At least with NetBSD 5 and 6, _XOPEN_SOURCE needs to be defined as it is for Linux. My inclination would be to use this definition as the default and special case the systems where it doesn't work, but this change works for me. I've tested this on both NetBSD 5 and 6, on 32- and 64-bit systems.
Full disclosure: to link on 32-bit systems, I also had to add a -march setting to CFLAGS. Otherwise I get an undefined error for __sync_add_and_fetch_4. I think that's just a general gcc issue and I don't have a patch for it.
Thanks.