All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP]  Where is defined TEST_ERRNO when 'make UCLINUX=1'?
@ 2013-07-19 14:28 Benoit Marcot
  2013-07-30 17:24 ` chrubis
  0 siblings, 1 reply; 4+ messages in thread
From: Benoit Marcot @ 2013-07-19 14:28 UTC (permalink / raw)
  To: ltp-list

Hi,

I am building LTP for UCLINUX, and I went through an undefined symbol TEST_ERRNO with 'make UCLINUX=1'.

As far as I understand, making with 'UCLINUX=1' defines also _USC_LIB_ in lib/Makefile:

ifeq ($(UCLINUX),1)
CFLAGS                  += -D_USC_LIB_
endif

In include/usctest.h, if _USC_LIB_ is defined then TEST_ERRNO is declared as extern, hence still not defined:

#ifdef  _USC_LIB_
extern int TEST_ERRNO;
#else

Finally, the last place where TEST_ERRNO could be defined is in lib/parse_opts.c; if UNIT_TEST is somewhere defined:

#if UNIT_TEST
int TEST_ERRNO;
...

So my questions are: should I compile with CFLAGS += -DUNIT_TEST=1? How to use parse_opts.c?

Thanks,

--
Benoit Marcot


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] Where is defined TEST_ERRNO when 'make UCLINUX=1'?
  2013-07-19 14:28 [LTP] Where is defined TEST_ERRNO when 'make UCLINUX=1'? Benoit Marcot
@ 2013-07-30 17:24 ` chrubis
       [not found]   ` <1C23526A7C42DB45BBF55B662C7C530E25B4AAF0D3@BUNGLE.Emea.Arm.com>
  0 siblings, 1 reply; 4+ messages in thread
From: chrubis @ 2013-07-30 17:24 UTC (permalink / raw)
  To: Benoit Marcot; +Cc: ltp-list

Hi!
> I am building LTP for UCLINUX, and I went through an undefined symbol TEST_ERRNO with 'make UCLINUX=1'.
> 
> As far as I understand, making with 'UCLINUX=1' defines also _USC_LIB_ in lib/Makefile:
> 
> ifeq ($(UCLINUX),1)
> CFLAGS                  += -D_USC_LIB_
> endif
> 
> In include/usctest.h, if _USC_LIB_ is defined then TEST_ERRNO is declared as extern, hence still not defined:
> 
> #ifdef  _USC_LIB_
> extern int TEST_ERRNO;
> #else

That seems to be really messed up, so without UCLINUX the TEST_ERRNO is
defined in the header which is included in the test and in the library.
I wonder how that passes through the linker, that looks like
redefinition to me...

And with UCLINUX it's does not look to be defined anywhere.

Hmm, we should really clean up this part.

> Finally, the last place where TEST_ERRNO could be defined is in lib/parse_opts.c; if UNIT_TEST is somewhere defined:
> 
> #if UNIT_TEST
> int TEST_ERRNO;
> ...
> 
> So my questions are: should I compile with CFLAGS += -DUNIT_TEST=1? How to use parse_opts.c?
> 

If you define the UNIT_TEST the parse_opts.c will contain main() (it's
intended for testing the LTP lib interface only).

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] Where is defined TEST_ERRNO when 'make UCLINUX=1'?
       [not found]   ` <1C23526A7C42DB45BBF55B662C7C530E25B4AAF0D3@BUNGLE.Emea.Arm.com>
@ 2013-08-01 17:04     ` chrubis
       [not found]       ` <1C23526A7C42DB45BBF55B662C7C530E25B4B64541@BUNGLE.Emea.Arm.com>
  0 siblings, 1 reply; 4+ messages in thread
From: chrubis @ 2013-08-01 17:04 UTC (permalink / raw)
  To: Benoit Marcot; +Cc: ltp-list

Hi!
> > That seems to be really messed up, so without UCLINUX the TEST_ERRNO is
> > defined in the header which is included in the test and in the library.
> > I wonder how that passes through the linker, that looks like redefinition to
> > me...
> >
> > And with UCLINUX it's does not look to be defined anywhere.
> >
> > Hmm, we should really clean up this part.
> 
> I have quickly patched my local working copy with the following change, but I am not really fond of this kind of nested conditions...
> 
> From 67bb4cc0a23c7a1c48acb85b49323edb9c93ff0a Mon Sep 17 00:00:00 2001
> From: Benoit Marcot < benoit.marcot@gmail.com >
> Date: Thu, 25 Jul 2013 15:45:17 +0100
> Subject: [PATCH] usctest.h: fix TEST_ERRNO definition when compiling with
>  'make UCLINUX=1'.
> 
> Compiling with 'make UCLINUX=1' adds -D_USC_LIB_, which make TEST_ERRNO declared as extern. This patch defines TEST_ERRNO.
> 
> Signed-off-by: Benoit Marcot <benoit.marcot@gmail.com>
> ---
>  include/usctest.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/usctest.h b/include/usctest.h
> index 90b124f..290b379 100644
> --- a/include/usctest.h
> +++ b/include/usctest.h
> @@ -157,7 +157,7 @@ struct usc_errno_t {
>   ****
>   ****
>   **********************************************************************/
> -#ifdef  _USC_LIB_
> +#if defined(_USC_LIB_) && (!defined(UCLINUX) || UCLINUX == 0)
> 
>  extern long TEST_RETURN;
>  extern int TEST_ERRNO;

The more I'm looking at the issue the more I think that the best
solution is to remove the ifdefs and left only the extern definitons
there and add the corresponding declaration somewhere into the library
sources, presumbly tst_res.c.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] Where is defined TEST_ERRNO when 'make UCLINUX=1'?
       [not found]       ` <1C23526A7C42DB45BBF55B662C7C530E25B4B64541@BUNGLE.Emea.Arm.com>
@ 2013-08-05 12:38         ` chrubis
  0 siblings, 0 replies; 4+ messages in thread
From: chrubis @ 2013-08-05 12:38 UTC (permalink / raw)
  To: Benoit Marcot; +Cc: ltp-list

Hi!
I've just pushed this fix along with a bit wider cleanup.

Thanks!
-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-05 12:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-19 14:28 [LTP] Where is defined TEST_ERRNO when 'make UCLINUX=1'? Benoit Marcot
2013-07-30 17:24 ` chrubis
     [not found]   ` <1C23526A7C42DB45BBF55B662C7C530E25B4AAF0D3@BUNGLE.Emea.Arm.com>
2013-08-01 17:04     ` chrubis
     [not found]       ` <1C23526A7C42DB45BBF55B662C7C530E25B4B64541@BUNGLE.Emea.Arm.com>
2013-08-05 12:38         ` chrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.