Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 226329 - Implicit or explicit -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ?
Summary: Implicit or explicit -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ?
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-13 12:47 UTC by kunitoki (Lucio Asnaghi)
Modified: 2008-06-16 14:40 UTC (History)
0 users

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


Attachments
server_2007.0_emerge.info (server_2007.0_emerge.info,4.19 KB, text/plain)
2008-06-13 13:01 UTC, kunitoki (Lucio Asnaghi)
Details
server_2008.0_emerge.info (server_2008.0_emerge.info,3.25 KB, text/plain)
2008-06-13 13:02 UTC, kunitoki (Lucio Asnaghi)
Details
gdal patch, add force for large file support and oracle (if not already committed into tree) (gdal-1.5.1.patch,1.97 KB, patch)
2008-06-16 09:57 UTC, kunitoki (Lucio Asnaghi)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kunitoki (Lucio Asnaghi) 2008-06-13 12:47:47 UTC
I have 2 machines i use for serving maps and raster tif/ecw files,
both have been installed from gentoo: one from 2007.0 and the latter
from 2008.0_beta2.
I've then installed the same version of GDAL library on both servers,
which is able to open and rasterize raster data from image files.

In the first 2007.0 server i'm able to open > 4GB files without any problems,
while in the 2008.0 one i keep gdal having troubles opening files > 4GB.

Then i checked and i had to manually force -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
in make.conf in the 2008.0, thus any ebuild that do not explicitly append those flags
with "append-cflags" command will have this problem in handling big files.

Why the 2007.0 server have not this problem ?

**** make.conf (2007.0 server - working)
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}" 
MAKEOPTS="-j2"

**** make.conf (2008.0_beta2 server - not working without explicit defines)
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
CXXFLAGS="${CFLAGS}"
CHOST="i686-pc-linux-gnu"
MAKEOPTS="-j2"

Could be that the different -march is setting different -D flags ?

Another patch could be to explicitly append-cflag "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
to every ebuild might need to access big files (gdal for example ?)

The problem is quite strange.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-06-13 12:54:09 UTC
Could you please post `emerge --info' for both machines?
Comment 2 kunitoki (Lucio Asnaghi) 2008-06-13 13:01:20 UTC
Created attachment 156623 [details]
server_2007.0_emerge.info

emerge --info of server 2007.0 (working without explicit large files defines)
Comment 3 kunitoki (Lucio Asnaghi) 2008-06-13 13:02:00 UTC
Created attachment 156625 [details]
server_2008.0_emerge.info

emerge --info of server 2008.0_beta2 (not working without explicitly setting large file defines)
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2008-06-13 13:06:27 UTC
Does it help to use the same overlays on both? :)

PORTDIR_OVERLAY="/usr/portage/local/layman/toolchain /usr/portage/local/layman/sunrise /usr/portage/local/layman/pro-audio /usr/local/portage"
Comment 5 kunitoki (Lucio Asnaghi) 2008-06-13 14:22:23 UTC
i've done the opposite (reemerged gdal in the working server WITHOUT the overlays) and it is still working on it without explicitly setting anything on make.conf. 
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2008-06-14 13:52:08 UTC
It's not about make.conf, but very likely about a profile.bashrc in one of the overlays.
Comment 7 kunitoki (Lucio Asnaghi) 2008-06-16 09:29:07 UTC
but if i remove any references to the overlays and i recompile in both servers i get the same result.
Comment 8 kunitoki (Lucio Asnaghi) 2008-06-16 09:57:16 UTC
Created attachment 157053 [details, diff]
gdal patch, add force for large file support and oracle (if not already committed into tree)
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2008-06-16 14:17:41 UTC
Sorry. I still don't see how this is a bug in Gentoo - obviously one of your configuration files is appending these CFLAGS. Most likely it's one of the overlays' profile.bashrc doing it. Please reopen this bug *only* when you have done these two things: 1) find the source of the appended CFLAGS, 2) find a way to blame this on Gentoo (and not, say, your own configuration changes from a good while ago, or perhaps the configuration found in a third party overlay).
Comment 10 kunitoki (Lucio Asnaghi) 2008-06-16 14:40:47 UTC
i can close this bug only if you can apply the gdal patch for large files. it seems the most proper solution right now.

for me is a bug in gentoo, if it compiles gdal without setting "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" explicitly.

One of the reason people use gdal is to handle large RASTER files. Not being able to open RASTER > 4GB is not good since a lot of people will. and not everybody still have some of those obscure scripts that i might have (i still can't find where after removing any reference to overlays).