[PATCH] D64482: [Driver] Define _FILE_OFFSET_BITS=64 on Solaris

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 10 19:31:32 PDT 2019


MaskRay added a comment.

In D64482#1578376 <https://reviews.llvm.org/D64482#1578376>, @ro wrote:

> In D64482#1578245 <https://reviews.llvm.org/D64482#1578245>, @MaskRay wrote:
>
> > > There's one caveat: gcc defines _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE for C++ only, while clang has long been doing it for all languages
> >
> > Can you explain more about the hack https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=0f97ccfdccc033f543ccbcb220697e62e84bf01f
>
>
> No hack at all ;-)  See the patch submission https://gcc.gnu.org/ml/gcc-patches/2018-06/msg01320.html for details.  Apart from that,
>  this is the direction libstdc++/g++ mean to take in general.


Honestly I find such enforced C/C++ difference very unfortunate... e.g.

  if (Opts.CPlusPlus)
    Builder.defineMacro("_GNU_SOURCE");

Solaris seems the only exception that defines these Large File Support extension macros on the compiler driver side. Isn't it possible to do it in a common system header file?

That rationale will be better than this paragraph in the description:

> make check-all currently fails on x86_64-pc-solaris2.11 when building with GCC 9:

With the current description, a casual reader (like I) would just think this patch is probably not doing things at the correct layer.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64482/new/

https://reviews.llvm.org/D64482





More information about the cfe-commits mailing list