1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-24 15:04:13 +00:00
cde/src/cmd/ksh93/features/rlimits
Martijn Dekker f37098f177 Build fix for Linux i386
iffe feature test that add a -D_LARGEFILE64_SOURCE compiler flag to
detect the presence of 64-bit types like off64_t are very
incorrect; they always find the type even if the rest of the source
is not compiled with that flag, causing an inconsistent compilation
environment. This was the cause of mysterious failures to compile
some feature tests on Linux i386 -- it tried to use an off64_t type
that was wrongly detected.

A flag like -D_LARGEFILE64_SOURCE needs to be added to the compiler
flags consistently so it is used for compiling all files and tests.

src/lib/libast/features/dirent,
src/lib/libast/features/fs,
src/lib/libast/features/lib,
src/lib/libast/features/mmap,
src/cmd/ksh93/features/rlimits:
- Remove the -D_LARGEFILE64_SOURCE flag from all the tests that
  used it.
- Fix some preprocessor directives for compiling without
  _LARGEFILE64_SOURCE. We cannot rely on the result of the _lib_*64
  tests because those functions are still found in glibc even if
  _LARGEFILE64_SOURCE is not defined; we have to check for the
  existence of the type definitions before using them.

src/cmd/INIT/cc.linux.i386,
src/cmd/INIT/cc.linux.i386-icc:
- Add/update compiler wrappers to hardcode -D_LARGEFILE64_SOURCE
  in the flags for the default compiler. If it is overriden with
  $CC, then it needs to be added manually if desired.
2021-01-31 23:47:43 +00:00

25 lines
530 B
Text

hdr,sys resource,vlimit sys/time.h
lib getrlimit,getrlimit64,ulimit,vlimit
typ rlim_t,rlim64_t sys/types.h sys/time.h sys/resource.h
cat{
#if _sys_resource
# include <sys/resource.h>
# if _lib_getrlimit64 && _typ_rlim64_t
# undef getrlimit
# define getrlimit getrlimit64
# undef setrlimit
# define setrlimit setrlimit64
# undef rlimit
# define rlimit rlimit64
# undef rlim_t
# define rlim_t rlim64_t
# ifdef RLIM64_INFINITY
# undef RLIM_INFINITY
# define RLIM_INFINITY RLIM64_INFINITY
# endif
# endif
#endif
}end