glibc:azanella/y2038

Last commit made on 2021-06-07
Get this branch:
git clone -b azanella/y2038 https://git.launchpad.net/glibc

Branch merges

Branch information

Name:
azanella/y2038
Repository:
lp:glibc

Recent commits

29de4b3... by Adhemerval Zanella on 2021-05-20

Use LFS and 64 bit time for installed programs

The installed programs are built with a combination of different
values for MODULE_NAME, as below. To enable both Long File Support
and 64 bt time, -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 is added for
nonlib, nscd, lddlibc4, ldconfig, locale_programs, and iconvprogs
modules.

  nscd/nscd
    nscd/nscd.o MODULE_NAME=nscd
    nscd/connections.o MODULE_NAME=nscd
    nscd/pwdcache.o MODULE_NAME=nscd
    nscd/getpwnam_r.o MODULE_NAME=nscd
    nscd/getpwuid_r.o MODULE_NAME=nscd
    nscd/grpcache.o MODULE_NAME=nscd
    nscd/getgrnam_r.o MODULE_NAME=nscd
    nscd/getgrgid_r.o MODULE_NAME=nscd
    nscd/hstcache.o MODULE_NAME=nscd
    nscd/gethstbyad_r.o MODULE_NAME=nscd
    nscd/gethstbynm3_r.o MODULE_NAME=nscd
    nscd/getsrvbynm_r.o MODULE_NAME=nscd
    nscd/getsrvbypt_r.o MODULE_NAME=nscd
    nscd/servicescache.o MODULE_NAME=nscd
    nscd/dbg_log.o MODULE_NAME=nscd
    nscd/nscd_conf.o MODULE_NAME=nscd
    nscd/nscd_stat.o MODULE_NAME=nscd
    nscd/cache.o MODULE_NAME=nscd
    nscd/mem.o MODULE_NAME=nscd
    nscd/nscd_setup_thread.o MODULE_NAME=nscd
    nscd/xmalloc.o MODULE_NAME=nscd
    nscd/xstrdup.o MODULE_NAME=nscd
    nscd/aicache.o MODULE_NAME=nscd
    nscd/initgrcache.o MODULE_NAME=nscd
    nscd/gai.o MODULE_NAME=nscd
    nscd/res_hconf.o MODULE_NAME=nscd
    nscd/netgroupcache.o MODULE_NAME=nscd
    nscd/cachedumper.o MODULE_NAME=nscd
  elf/lddlibc4
    elf/lddlibc4 MODULE_NAME=lddlibc4
  elf/pldd
    elf/pldd.o MODULE_NAME=nonlib
    elf/xmalloc.o MODULE_NAME=nonlib
  elf/sln
    elf/sln.o MODULE_NAME=nonlib
    elf/static-stubs.o MODULE_NAME=nonlib
  elf/sprof MODULE_NAME=nonlib
  elf/ldconfig
    elf/ldconfig.o MODULE_NAME=ldconfig
    elf/cache.o MODULE_NAME=nonlib
    elf/readlib.o MODULE_NAME=nonlib
    elf/xmalloc.o MODULE_NAME=nonlib
    elf/xstrdup.o MODULE_NAME=nonlib
    elf/chroot_canon.o MODULE_NAME=nonlib
    elf/static-stubs.o MODULE_NAME=nonlib
    elf/stringtable.o MODULE_NAME=nonlib
  io/pwd
    io/pwd.o MODULE_NAME=nonlib
  locale/locale
    locale/locale.o MODULE_NAME=locale_programs
    locale/locale-spec.o MODULE_NAME=locale_programs
    locale/charmap-dir.o MODULE_NAME=locale_programs
    locale/simple-hash.o MODULE_NAME=locale_programs
    locale/xmalloc.o MODULE_NAME=locale_programs
    locale/xstrdup.o MODULE_NAME=locale_programs
    locale/record-status.o MODULE_NAME=locale_programs
    locale/xasprintf.o MODULE_NAME=locale_programs
  locale/localedef
    locale/localedef.o MODULE_NAME=locale_programs
    locale/ld-ctype.o MODULE_NAME=locale_programs
    locale/ld-messages.o MODULE_NAME=locale_programs
    locale/ld-monetary.o MODULE_NAME=locale_programs
    locale/ld-numeric.o MODULE_NAME=locale_programs
    locale/ld-time.o MODULE_NAME=locale_programs
    locale/ld-paper.o MODULE_NAME=locale_programs
    locale/ld-name.o MODULE_NAME=locale_programs
    locale/ld-address.o MODULE_NAME=locale_programs
    locale/ld-telephone.o MODULE_NAME=locale_programs
    locale/ld-measurement.o MODULE_NAME=locale_programs
    locale/ld-identification.o MODULE_NAME=locale_programs
    locale/ld-collate.o MODULE_NAME=locale_programs
    locale/charmap.o MODULE_NAME=locale_programs
    locale/linereader.o MODULE_NAME=locale_programs
    locale/locfile.o MODULE_NAME=locale_programs
    locale/repertoire.o MODULE_NAME=locale_programs
    locale/locarchive.o MODULE_NAME=locale_programs
    locale/md5.o MODULE_NAME=locale_programs
    locale/charmap-dir.o MODULE_NAME=locale_programs
    locale/simple-hash.o MODULE_NAME=locale_programs
    locale/xmalloc.o MODULE_NAME=locale_programs
    locale/xstrdup.o MODULE_NAME=locale_programs
    locale/record-status.o MODULE_NAME=locale_programs
    locale/xasprintf.o MODULE_NAME=locale_programs
  catgets/gencat
    catgets/gencat.o MODULE_NAME=nonlib
    catgets/xmalloc.o MODULE_NAME=nonlib
  nss/makedb
    nss/makedb.o MODULE_NAME=nonlib
    nss/xmalloc.o MODULE_NAME=nonlib
    nss/hash-string.o MODULE_NAME=nonlib
  nss/getent
    nss/getent.o MODULE_NAME=nonlib
  posix/getconf
    posix/getconf.o MODULE_NAME=nonlib
  login/utmpdump
    login/utmpdump.o MODULE_NAME=nonlib
  debug/pcprofiledump
    debug/pcprofiledump.o MODULE_NAME=nonlib
  timezone/zic
    timezone/zic.o MODULE_NAME=nonlib
  timezone/zdump
    timezone/zdump.o MODULE_NAME=nonlib
  iconv/iconv_prog
    iconv/iconv_prog.o MODULE_NAME=nonlib
    iconv/iconv_charmap.o MODULE_NAME=iconvprogs
    iconv/charmap.o MODULE_NAME=iconvprogs
    iconv/charmap-dir.o MODULE_NAME=iconvprogs
    iconv/linereader.o MODULE_NAME=iconvprogs
    iconv/dummy-repertoire.o MODULE_NAME=iconvprogs
    iconv/simple-hash.o MODULE_NAME=iconvprogs
    iconv/xstrdup.o MODULE_NAME=iconvprogs
    iconv/xmalloc.o MODULE_NAME=iconvprogs
    iconv/record-status.o MODULE_NAME=iconvprogs
  iconv/iconvconfig
    iconv/iconvconfig.o MODULE_NAME=nonlib
    iconv/strtab.o MODULE_NAME=iconvprogs
    iconv/xmalloc.o MODULE_NAME=iconvprogs
    iconv/hash-string.o MODULE_NAME=iconvprogs

Also, to avoid addinf both LFS and 64 bit time support on internal
tests they are moved to a newer 'testsuite-internal' module. It
should be similar to 'nonlib' regarding internal definition and
linking namespace.

This patch also enables LFS and 64 bit support of libsupport container
programs (echo-container, test-container, shell-container, and
true-container).

Checked on x86_64-linux-gnu and i686-linux-gnu.

7271aea... by Adhemerval Zanella on 2021-03-02

Use 64 bit time_t stat internally

For the legacy ABI with supports 32 bit time_t it calls the 64 bit
time directly, since the LFS symbols calls the 64 bit time_t ones
internally.

Checked on i686-linux-gnu and x86_64-linux-gnu.

f558cda... by Adhemerval Zanella on 2021-02-17

y2038: Add test coverage

It is enabled through a new rule, tests-y2038, which is built only
when the ABI supports the comapt 64-bit time_t (defined by the
header time64-compat.h, which also enables the creation of the
symbol Version for Linux). It means the tests are not built
for ABI which already provide default 64-bit time_t.

The new rule already adds the required LFS and 64-bit time_t
compiler flags.

The current coverage is:

  * libc:
    - adjtime tst-adjtime-time64
    - adjtimex tst-adjtimex-time64
    - clock_adjtime tst-clock_adjtime-time64
    - clock_getres tst-clock-time64, tst-cpuclock1-time64
    - clock_gettime tst-clock-time64, tst-clock2-time64,
        tst-cpuclock1-time64
    - clock_nanosleep tst-clock_nanosleep-time64,
        tst-cpuclock1-time64
    - clock_settime tst-clock2-time64
    - cnd_timedwait tst-cnd-timedwait-time64
    - ctime tst-ctime-time64
    - ctime_r tst-ctime-time64
    - difftime tst-difftime-time64
    - fstat tst-stat-time64
    - fstatat tst-stat-time64
    - futimens tst-futimens-time64
    - futimes tst-futimes-time64
    - futimesat tst-futimesat-time64
    - fts_* tst-fts-time64
    - getitimer tst-itimer-timer64
    - getrusage
    - gettimeofday tst-clock_nanosleep-time64
    - glob / globfree tst-gnuglob64-time64
    - gmtime tst-gmtime-time64
    - gmtime_r tst-gmtime-time64
    - lstat tst-stat-time64
    - localtime tst-y2039-time64
    - localtime_t tst-y2039-time64
    - lutimes tst-lutimes-time64
    - mktime tst-mktime4-time64
    - mq_timedreceive tst-mqueue{1248}-time64
    - mq_timedsend tst-mqueue{1248}-time64
    - msgctl test-sysvmsg-time64
    - mtx_timedlock tst-mtx-timedlock-time64
    - nanosleep tst-cpuclock{12}-time64,
        tst-mqueue8-time64, tst-clock-time64
    - nftw / ftw ftwtest-time64
    - ntp_adjtime tst-ntp_adjtime-time64
    - ntp_gettime tst-ntp_gettime-time64
    - ntp_gettimex tst-ntp_gettimex-time64
    - ppoll tst-ppoll-time64
    - pselect tst-pselect-time64
    - pthread_clockjoin_np tst-join14-time64
    - pthread_cond_clockwait tst-cond11-time64
    - pthread_cond_timedwait tst-abstime-time64
    - pthread_mutex_clocklock tst-abstime-time64
    - pthread_mutex_timedlock tst-abstime-time64
    - pthread_rwlock_clockrdlock tst-abstime-time64, tst-rwlock14-time64
    - pthread_rwlock_clockwrlock tst-abstime-time64, tst-rwlock14-time64
    - pthread_rwlock_timedrdlock tst-abstime-time64, tst-rwlock14-time64
    - pthread_rwlock_timedwrlock tst-abstime-time64, tst-rwlock14-time64
    - pthread_timedjoin_np tst-join14-time64
    - recvmmsg tst-cancel4_2-time64
    - sched_rr_get_interval tst-sched_rr_get_interval-time64
    - select tst-select-time64
    - sem_clockwait tst-sem5-time64
    - sem_timedwait tst-sem5-time64
    - semctl test-sysvsem-time64
    - semtimedop test-sysvsem-time64
    - setitimer tst-mqueue2-time64, tst-itimer-timer64
    - settimeofday tst-settimeofday-time64
    - shmctl test-sysvshm-time64
    - sigtimedwait tst-sigtimedwait-time64
    - stat tst-stat-time64
    - thrd_sleep tst-thrd-sleep-time64
    - time tst-mqueue{1248}-time64
    - timegm tst-timegm-time64
    - timer_gettime tst-timer4-time64
    - timer_settime tst-timer4-time64
    - timerfd_gettime tst-timerfd-time64
    - timerfd_settime tst-timerfd-time64
    - timespec_get tst-timespec_get-time64
    - timespec_getres tst-timespec_getres-time64
    - utime tst-utime-time64
    - utimensat tst-utimensat-time64
    - utimes tst-utimes-time64
    - wait3 tst-wait3-time64
    - wait4 tst-wait4-time64

  * librt:
    - aio_suspend tst-aio6-time64
    - mq_timedreceive tst-mqueue{1248}-time64
    - mq_timedsend tst-mqueue{1248}-time64
    - timer_gettime tst-timer4-time64
    - timer_settime tst-timer4-time64

  * libanl:
    - gai_suspend

Reviewed-by: Lukasz Majewski <email address hidden>
Reviewed-by: Carlos O'Donell <email address hidden>
Tested-by: Carlos O'Donell <email address hidden>

96e284d... by Adhemerval Zanella on 2021-02-26

libsupport: Add 64 bit time_t support for stat functions

The patch adds redirections for xstat, xlstat, and xfstat when
_TIME_BITS=64 is defined.

Reviewed-by: Lukasz Majewski <email address hidden>
Reviewed-by: Carlos O'Donell <email address hidden>
Tested-by: Carlos O'Donell <email address hidden>

7cd40e5... by Adhemerval Zanella on 2021-02-25

libsupport: Add 64 bit time_t support for time functions

The patch adds redirections for xclock_gettime, xclock_settime,
timespec_add, timespec_sub, test_timespec_before_impl,
test_timespec_equal_or_after_impl, support_timespec_ns,
support_timespec_normalize, and support_timespec_check_in_range when
_TIME_BITS=64 is defined.

Co-authored-by: Lukasz Majewski <email address hidden>
Tested-by: Carlos O'Donell <email address hidden>

e85ec6e... by Adhemerval Zanella on 2021-03-03

io: Add ftw64 with 64 bit time_t support

Similar to fts, ftw routines passes a stat pointer that might
differ of size and layout when 64 bit time API is used.

Checked on i686-linux-gnu and x86_64-linux-gnu.

Reviewed-by: Lukasz Majewski <email address hidden>
Reviewed-by: Carlos O'Donell <email address hidden>
Tested-by: Carlos O'Donell <email address hidden>

f313dd8... by Adhemerval Zanella on 2021-03-03

io: Add fts64 with 64 bit time_t support

Similar to glob, fts routines passes a stat pointer that might
differ of size and layout when 64 bit time API is used.

Checked on i686-linux-gnu and x86_64-linux-gnu.

9eaf86f... by Adhemerval Zanella on 2021-03-02

posix: Add glob64 with 64 bit time_t support

The glob might pass a different stat struct for gl_stat and gl_lstat
when GLOB_ALTDIRFUNC is used. This requires add a new 64 time
version that also uses 64 time stat functions.

Checked on i686-linux-gnu and x86_64-linux-gnu.

ca45509... by Adhemerval Zanella on 2021-02-17

y2038: Add support for 64 bit time on legacy ABIs

A new build flag, _TIME_BITS, enables the usage of the newer 64 bit
time symbols for legacy ABI (where 32 bit time_t is default). The 64
bit time support is only enabled if LFS (_FILE_OFFSET_BITS=64) is
also used.

Different than LFS support, the y2038 symbols are added only for the
required ABIs (armhf, csky, hppa, i386, m68k, microblaze, mips32,
mips64-n32, nios2, powerpc32, sparc32, s390-32, and sh). The ABIs with
64 bit time support are unchanged, both for symbol and types
redirection.

On Linux the full 64 bit time support requires a minimum of kernel
version v5.1. Otherwise, the 32 bit fallbacks are used and might
results in error with overflow return code (EOVERFLOW).

The i686-gnu does not yet support 64 bit time.

This patch exports following rediretions to support 64 bit time:

  * libc:
    adjtime
    adjtimex
    clock_adjtime
    clock_getres
    clock_gettime
    clock_nanosleep
    clock_settime
    cnd_timedwait
    ctime
    ctime_r
    difftime
    fstat
    fstatat
    futimens
    futimes
    futimesat
    getitimer
    getrusage
    gettimeofday
    gmtime
    gmtime_r
    localtime
    localtime_r
    lstat_time
    lutimes
    mktime
    msgctl
    mtx_timedlock
    nanosleep
    nanosleep
    ntp_gettime
    ntp_gettimex
    ppoll
    pselec
    pselect
    pthread_clockjoin_np
    pthread_cond_clockwait
    pthread_cond_timedwait
    pthread_mutex_clocklock
    pthread_mutex_timedlock
    pthread_rwlock_clockrdlock
    pthread_rwlock_clockwrlock
    pthread_rwlock_timedrdlock
    pthread_rwlock_timedwrlock
    pthread_timedjoin_np
    recvmmsg
    sched_rr_get_interval
    select
    sem_clockwait
    semctl
    semtimedop
    sem_timedwait
    setitimer
    settimeofday
    shmctl
    sigtimedwait
    stat
    thrd_sleep
    time
    timegm
    timerfd_gettime
    timerfd_settime
    timespec_get
    utime
    utimensat
    utimes
    utimes
    wait3
    wait4

  * librt:
    aio_suspend
    mq_timedreceive
    mq_timedsend
    timer_gettime
    timer_settime

  * libanl:
    gai_suspend

Reviewed-by: Lukasz Majewski <email address hidden>
Reviewed-by: Carlos O'Donell <email address hidden>
Tested-by: Carlos O'Donell <email address hidden>

347cbc7... by Adhemerval Zanella on 2021-03-02

time: Add 64 bit time support for getdate

The getdate is basically a wrapper localtime and mktime. The 64 bit
time support is done calling the 64 bit internal functions, there is
no need to add a new symbol version.

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Lukasz Majewski <email address hidden>
Reviewed-by: Carlos O'Donell <email address hidden>
Tested-by: Carlos O'Donell <email address hidden>