[SERVER-17089] file_allocator.cpp compilation fails due to missing posix_fallocate() in uClibc Created: 28/Jan/15 Updated: 27/Apr/15 Resolved: 29/Jan/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | 3.0.0-rc6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Raffaele Rossi | Assignee: | Benety Goh |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | 32-bit | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
MIPS, 32-bit, uClibc |
||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | Linux | ||||||||
| Steps To Reproduce: | Build for a platform missing posix_fallocate() |
||||||||
| Participants: | |||||||||
| Description |
|
posix_fallocate() is used in file_allocator.cpp but some C library doesn't provide it (e.g uClibc). This seems to be the case even when we change the preprocessor check form _linux_ to the documented _XOPEN_SOURCE >= 600 || __POSIX_C_SOURCE >= 200112L. |
| Comments |
| Comment by Benety Goh [ 04/Feb/15 ] | ||
|
Thank you for the update! | ||
| Comment by Raffaele Rossi [ 03/Feb/15 ] | ||
|
Back again. Apologies for any confusion. | ||
| Comment by Raffaele Rossi [ 29/Jan/15 ] | ||
|
I'll try look deeper into the uClibc side. I thought acm agreed that checking for posix_fallocate() was a good thing to do in first place. | ||
| Comment by Benety Goh [ 29/Jan/15 ] | ||
|
I would suggest revisiting your uClibc configuration to make posix_fallocate visible to your build. If that doesn't work, it might be best to file a bug report with uClibc. We can always reopen this ticket and review the configure check in greater detail once we get more information on the underlying uClibc issue. | ||
| Comment by Raffaele Rossi [ 28/Jan/15 ] | ||
|
No. It was fine but I just thought that was cleaner to rely on the linker failing rather than dealing with a cloned environment just to switch -Werror on. I remember I did have a look at the other checks and this would've been the only one switching -Werror to do so. It seemed that other tests used a link-time check. Which did make sense to me. Let me know what's the best way for you guys. I'll be happy to change. | ||
| Comment by Benety Goh [ 28/Jan/15 ] | ||
|
Also, I have noticed in your branch that you switched the configure-time check from a compilation check to a link time check: https://github.com/raffopazzo/mongo/commit/bba9cbf6029356c055bfc52b77d17934fa606a19 Was the compile time check insufficient in your environment to detect the availability of posix_fallocate()? | ||
| Comment by Raffaele Rossi [ 28/Jan/15 ] | ||
|
I did try it when I first came across this issue. So I falled back to the configure-time check. | ||
| Comment by Benety Goh [ 28/Jan/15 ] | ||
|
raffopazzo, could you please try replacing file_allocator.cpp:254
with:
| ||
| Comment by Raffaele Rossi [ 28/Jan/15 ] | ||
|
Related to FIX available on fork: https://github.com/raffopazzo/mongo/tree/posix_fallocate Shall I submit a pull request? Cheers. |