linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	Palmer Dabbelt <palmerdabbelt@google.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Arnd Bergmann <arnd@arndb.de>, Andreas Schwab <schwab@suse.de>,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	Helmut Grohne <helmutg@debian.org>, Zong Li <zongbox@gmail.com>,
	debian-arm@lists.debian.org,
	Alistair Francis <alistair.francis@wdc.com>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	"Maciej W. Rozycki" <macro@wdc.com>,
	Alistair Francis <alistair23@gmail.com>,
	arcml <linux-snps-arc@lists.infradead.org>
Subject: Re: switching ARC to 64-bit time_t (Re: [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64)
Date: Wed, 26 Feb 2020 14:18:42 +0100	[thread overview]
Message-ID: <20200226141842.652ebbcc@jawa> (raw)
In-Reply-To: <alpine.DEB.2.21.2002251427240.25788@digraph.polyomino.org.uk>


[-- Attachment #1.1: Type: text/plain, Size: 4020 bytes --]

Hi Joseph,

> On Tue, 25 Feb 2020, Lukasz Majewski wrote:
> 
> > Lets consider for example __mq_timedsend_time64.
> > 
> > With lib<name>_hidden_def/proto kept (NOT removed as in [1]):
> > GDB:
> > __GI___mq_timedsend_time64   [*]
> > 
> > (No build errors, linking with test setup works as expected).  
> 
> What is the actual testcase, and the exact command line used to
> compile it?

The test case is a separate program [1] compiled with [2] (the
test_y2038 make target)

The glibc under test is installed on rootfs run by QEMU for ARM.

The lack of redirection, when I keep lib<name>_hidden_proto/
lib<name>_hidden_def for __mq_timedsend_time64, is seen when I debug
with GDB the 'test_y2038' program.

The glibc compiles correctly.

> 
> _TIME_BITS=64 redirection is only relevant for programs built with
> glibc, using the installed headers - not for building glibc itself.
> 
> lib<name>_hidden_proto is only relevant for building glibc, with its 
> internal headers - not for programs built with glibc.

It seems like not removing lib<name>_hidden_proto/ lib<name>_hidden_def
for __mq_timedsend_time64 in glibc sources prevents the redirection on
installed glibc / headers when 'test_y2038' program is run.

> 
> If you're talking about a glibc testcase, such tests should be in
> tests not tests-internal, so _ISOMAC is defined when they are built,
> so the glibc internal headers just wrap the public ones without
> defining anything else.  In particular, the asm redirections from
> public headers should be in effect when tests are compiled, but not
> the lib<name>_hidden_proto redirections (but even for internal tests,
> lib<name>_hidden_proto shouldn't do anything because the build
> process knows they are tests not part of libc).

Unfortunately, mine Y2038 tests are a set of compiled programs (it is a
'legacy' code) and have nothing in common with glibc test suite.

The workflow is as follows (standard Yocto/OE):

1. Built the glibc and prepare "package" for other recipes.

2. For tests get the glibc "package" as a prerequisite. Use its
exported headers and libraries to build tests. Prepare test "package"

3. Install both above packages to rootfs

4. Run the rootfs with QEMU.

> 
> You should look at the preprocessed source from building the test
> with -save-temps and find out why the asm redirection from the public
> header isn't being effective (or if it is effective in the .o file
> for the test, look at what happens afterwards in glibc).  Since
> lib<name>_hidden_proto should not be called in the parts of headers
> included when building a test, its presence or absence should have no
> effect on the preprocessed source of the test.

Ok. I will dig the object files and generated temp files.

> 
> > hidden_def (__mq_timedsend)
> > weak_alias (__mq_timedsend, mq_timedsend) [**]
> > hidden_weak (mq_timedsend)  
> 
> If you have lib<name>_hidden_weak note you also need a corresponding 
> lib<name>_hidden_proto, for the name of the weak alias.  But you
> probably don't need to have lib<name>_hidden* for the weak alias at
> all, just make sure internal calls use the internal name.

As fair as I can tell the weak_alias () is necessary for correct
operation of mq_timedsend when external programs call it.

Glibc internally defines __mq_timedsend (also for archs with
__WORDSIZE==64), but it exports mq_timedsend (and user space programs
call it). One needs an alias (at least a weak one) between mq_timedsend
and __mq_timedsend{_time}. Am I correct?


> 

Links:

[1] -
https://github.com/lmajewski/y2038-tests/blob/master/test_mq_timedsend.c#L25

[2] - https://github.com/lmajewski/y2038-tests/blob/master/Makefile

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

  reply	other threads:[~2020-02-26 13:19 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1578824547.git.alistair.francis@wdc.com>
     [not found] ` <4e95f95966d8d7c6a8339160dc62d81c1f6a1bfb.1578824547.git.alistair.francis@wdc.com>
2020-02-12  0:14   ` [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64 Vineet Gupta
2020-02-12  0:14     ` Alistair Francis
2020-02-12  1:30       ` Joseph Myers
2020-02-14 22:39         ` Alistair Francis
2020-02-18 23:05           ` switching ARC to 64-bit time_t (Re: [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64) Vineet Gupta
2020-02-18 23:13             ` Joseph Myers
2020-02-19 23:09               ` Lukasz Majewski
2020-02-19 23:11             ` Lukasz Majewski
2020-02-20  8:31               ` Arnd Bergmann
2020-02-20  9:37                 ` Lukasz Majewski
2020-02-20 12:37                   ` Arnd Bergmann
2020-02-20 13:14                     ` Lukasz Majewski
2020-02-20 14:44                       ` Arnd Bergmann
2020-02-20 15:42                         ` Lukasz Majewski
2020-02-20 16:08                           ` Arnd Bergmann
2020-02-20 16:31                             ` Lukasz Majewski
2020-02-24  2:48                         ` Viresh Kumar
2020-02-21 19:56                     ` Alistair Francis
2020-02-22  8:42                   ` Arnd Bergmann
2020-02-24  9:00                     ` Lukasz Majewski
2020-02-24  9:46                       ` Andreas Schwab
2020-02-24 10:14                         ` Lukasz Majewski
2020-02-24 10:23                           ` Andreas Schwab
2020-02-24 10:36                             ` Lukasz Majewski
2020-02-24 10:42                               ` Andreas Schwab
2020-02-24 11:13                                 ` Lukasz Majewski
2020-02-24 12:41                                   ` Lukasz Majewski
2020-02-25  0:03                               ` Joseph Myers
2020-02-25 11:39                                 ` Lukasz Majewski
2020-02-25 14:36                                   ` Joseph Myers
2020-02-26 13:18                                     ` Lukasz Majewski [this message]
2020-02-26 14:48                                       ` Joseph Myers
2020-02-26 16:28                                         ` Lukasz Majewski
2020-02-25  9:03                       ` Arnd Bergmann
2020-02-20 16:27                 ` Helmut Grohne
2020-03-26  0:25                   ` ARC rebootstrap prereq (was Re: switching ARC to 64-bit time_t ) Vineet Gupta
2020-03-26  5:54                     ` Helmut Grohne
2020-03-26 11:51                       ` Alexey Brodkin
2020-03-26 12:24                         ` Helmut Grohne
2020-03-26 12:53                           ` Alexey Brodkin
2020-03-26 14:28                             ` Helmut Grohne
2020-03-26 19:04                               ` Lennart Sorensen
2020-08-26 14:39                       ` Vineet Gupta
2020-08-26 15:43                         ` Helmut Grohne
2020-08-26 21:16                           ` Aurelien Jarno
2021-02-24 20:17                             ` Vineet Gupta
2021-02-26  9:47                               ` Helmut Grohne
2021-02-26 15:58                                 ` Vineet Gupta
2021-08-21 17:36                             ` Aurelien Jarno
2020-02-12  1:42       ` [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64 Vineet Gupta
2020-02-12 12:58         ` Arnd Bergmann
2020-02-19  0:56   ` Vineet Gupta
2020-02-19  1:03     ` Alistair Francis
2020-02-19  1:31       ` Vineet Gupta
2020-02-19  8:30         ` Andreas Schwab
2020-02-19 18:42           ` Vineet Gupta
2020-02-19 23:18             ` Lukasz Majewski
2020-02-20  0:26               ` Vineet Gupta
2020-02-20  0:46                 ` Joseph Myers
2020-02-20  8:24                   ` Arnd Bergmann
2020-02-20 10:28                     ` Lukasz Majewski
2020-02-20 14:14                     ` Joseph Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200226141842.652ebbcc@jawa \
    --to=lukma@denx.de \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=alistair23@gmail.com \
    --cc=arnd@arndb.de \
    --cc=debian-arm@lists.debian.org \
    --cc=fweimer@redhat.com \
    --cc=helmutg@debian.org \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=macro@wdc.com \
    --cc=palmerdabbelt@google.com \
    --cc=schwab@suse.de \
    --cc=zongbox@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).