linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Cyclictest compile error when cross compiling for AT91SAM9260
       [not found] <1482871759.3943500.1348650924961.JavaMail.root@zmail.sgconsulting.it>
@ 2012-09-26  9:26 ` Forconi
  2012-09-26 19:34   ` Frank Rowand
  0 siblings, 1 reply; 4+ messages in thread
From: Forconi @ 2012-09-26  9:26 UTC (permalink / raw)
  To: linux-rt-users

Hi, 
I have compiled and installed an RT_PREEMPT patched kernel (2.6.33.7-rt29) on a AT91SAM9260 board.
I'd like to test latencies using cyclictest software (obtained from git repository).
My cross compile environment is gcc-4.2.3 with glibc-2.3.3 (obtained from the producer of the board).

This is the error I get when I try to compile:

$ make CROSS_COMPILE=arm-unknown-linux-gnu- librttest.a 
arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/rt-utils.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/error.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/rt-get_cpu.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
ar rcs librttest.a rt-utils.o error.o rt-get_cpu.o

$ make CROSS_COMPILE=arm-unknown-linux-gnu- cyclictest
arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/cyclictest/cyclictest.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
In file included from /opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/sys/sysinfo.h:25,
                 from src/cyclictest/cyclictest.c:34:
/opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/linux/kernel.h:716:2: warning: #warning Attempt to use kernel headers from user space, see http:
In file included from /opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/sys/resource.h:25,
                 from src/cyclictest/cyclictest.c:37:
/opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/bits/resource.h:35: error: expected identifier before numeric constant
src/cyclictest/cyclictest.c: In function 'timerthread':
src/cyclictest/cyclictest.c:703: warning: implicit declaration of function 'pthread_setaffinity_np'
make: *** [cyclictest.o] Error 1



Thank you for any suggestions and help.

Regards,
Samuele Forconi.

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

* Re: Cyclictest compile error when cross compiling for AT91SAM9260
  2012-09-26  9:26 ` Cyclictest compile error when cross compiling for AT91SAM9260 Forconi
@ 2012-09-26 19:34   ` Frank Rowand
  2012-09-27  8:23     ` Forconi
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Rowand @ 2012-09-26 19:34 UTC (permalink / raw)
  To: Forconi; +Cc: linux-rt-users@vger.kernel.org

On 09/26/12 02:26, Forconi wrote:
> Hi, 
> I have compiled and installed an RT_PREEMPT patched kernel (2.6.33.7-rt29) on a AT91SAM9260 board.
> I'd like to test latencies using cyclictest software (obtained from git repository).

Is the git repository:

   git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git

with current version:

   commit 857cdd5320ce1f293f5dbcbec79cc8fe22b0bebf
   Date:   Wed May 9 09:38:00 2012 -0500

> My cross compile environment is gcc-4.2.3 with glibc-2.3.3 (obtained from the producer of the board).
> 
> This is the error I get when I try to compile:
> 
> $ make CROSS_COMPILE=arm-unknown-linux-gnu- librttest.a 
> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/rt-utils.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2

That is somewhat surprising (unless you have modified the makefile).  If I
try that same command (but the proper CROSS_COMPILE value for my cross
tools), the cross gcc is not picked up.  But your example is clearly using
your cross gcc.  I instead use:

   make CC="${CROSS_COMPILE}gcc"

where CROSS_COMPILE is set for my cross tools:

  $ echo ${CROSS_COMPILE}
  arm-sony-linux-gnueabi-thumb2-

Everything builds ok, no need to make librttest.a and cyclictest individually.

I point out all of the above, because it does not seem like you have the
same source that I have, so I'm reluctant to dig any further.


> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/error.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/rt-get_cpu.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
> ar rcs librttest.a rt-utils.o error.o rt-get_cpu.o
> 
> $ make CROSS_COMPILE=arm-unknown-linux-gnu- cyclictest
> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/cyclictest/cyclictest.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
> In file included from /opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/sys/sysinfo.h:25,
>                  from src/cyclictest/cyclictest.c:34:
> /opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/linux/kernel.h:716:2: warning: #warning Attempt to use kernel headers from user space, see http:
> In file included from /opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/sys/resource.h:25,
>                  from src/cyclictest/cyclictest.c:37:
> /opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/bits/resource.h:35: error: expected identifier before numeric constant
> src/cyclictest/cyclictest.c: In function 'timerthread':
> src/cyclictest/cyclictest.c:703: warning: implicit declaration of function 'pthread_setaffinity_np'
> make: *** [cyclictest.o] Error 1
> 
> 
> 
> Thank you for any suggestions and help.
> 
> Regards,
> Samuele Forconi.



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

* Re: Cyclictest compile error when cross compiling for AT91SAM9260
  2012-09-26 19:34   ` Frank Rowand
@ 2012-09-27  8:23     ` Forconi
  2012-09-27 19:02       ` Frank Rowand
  0 siblings, 1 reply; 4+ messages in thread
From: Forconi @ 2012-09-27  8:23 UTC (permalink / raw)
  To: frank rowand; +Cc: linux-rt-users

Hi, 
I made a cleanup and a fresh clone of the git repository.

This is what I get running make:

$ make CC=arm-unknown-linux-gnu-gcc
src/pi_tests/pip_stress.c:240:2: error: #error _POSIX_THREAD_PROCESS_SHARED is not defined
src/pi_tests/pi_stress.c:78:2: error: #error "Can't run this test without PI Mutex support"
arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/cyclictest/cyclictest.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
src/cyclictest/cyclictest.c: In function 'timerthread':
src/cyclictest/cyclictest.c:700: warning: implicit declaration of function 'pthread_setaffinity_np'
arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/rt-utils.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/error.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/rt-get_cpu.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
ar rcs librttest.a rt-utils.o error.o rt-get_cpu.o
arm-unknown-linux-gnu-gcc -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2  -o cyclictest cyclictest.o librttest.a -lrt -lpthread -lrttest -L. 
cyclictest.o: In function `timerthread':
cyclictest.c:(.text+0x17ac): undefined reference to `pthread_setaffinity_np'
collect2: ld returned 1 exit status
make: *** [cyclictest] Error 1

It seems that the pthread_setaffinity_np is missing in pthread library (maybe I have an old lib?)


----- Messaggio originale -----
Da: "Frank Rowand" <frank.rowand@am.sony.com>
A: "Forconi" <forconi@wavecomm.it>
Cc: linux-rt-users@vger.kernel.org
Inviato: Mercoledì, 26 settembre 2012 21:34:17
Oggetto: Re: Cyclictest compile error when cross compiling for AT91SAM9260

On 09/26/12 02:26, Forconi wrote:
> Hi, 
> I have compiled and installed an RT_PREEMPT patched kernel (2.6.33.7-rt29) on a AT91SAM9260 board.
> I'd like to test latencies using cyclictest software (obtained from git repository).

Is the git repository:

   git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git

with current version:

   commit 857cdd5320ce1f293f5dbcbec79cc8fe22b0bebf
   Date:   Wed May 9 09:38:00 2012 -0500

> My cross compile environment is gcc-4.2.3 with glibc-2.3.3 (obtained from the producer of the board).
> 
> This is the error I get when I try to compile:
> 
> $ make CROSS_COMPILE=arm-unknown-linux-gnu- librttest.a 
> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/rt-utils.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2

That is somewhat surprising (unless you have modified the makefile).  If I
try that same command (but the proper CROSS_COMPILE value for my cross
tools), the cross gcc is not picked up.  But your example is clearly using
your cross gcc.  I instead use:

   make CC="${CROSS_COMPILE}gcc"

where CROSS_COMPILE is set for my cross tools:

  $ echo ${CROSS_COMPILE}
  arm-sony-linux-gnueabi-thumb2-

Everything builds ok, no need to make librttest.a and cyclictest individually.

I point out all of the above, because it does not seem like you have the
same source that I have, so I'm reluctant to dig any further.


> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/error.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/rt-get_cpu.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
> ar rcs librttest.a rt-utils.o error.o rt-get_cpu.o
> 
> $ make CROSS_COMPILE=arm-unknown-linux-gnu- cyclictest
> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/cyclictest/cyclictest.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
> In file included from /opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/sys/sysinfo.h:25,
>                  from src/cyclictest/cyclictest.c:34:
> /opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/linux/kernel.h:716:2: warning: #warning Attempt to use kernel headers from user space, see http:
> In file included from /opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/sys/resource.h:25,
>                  from src/cyclictest/cyclictest.c:37:
> /opt/glomation/gcc-4.2.3-glibc-2.3.3/bin/../lib/gcc/arm-unknown-linux-gnu/4.2.3/../../../../arm-unknown-linux-gnu/sys-include/bits/resource.h:35: error: expected identifier before numeric constant
> src/cyclictest/cyclictest.c: In function 'timerthread':
> src/cyclictest/cyclictest.c:703: warning: implicit declaration of function 'pthread_setaffinity_np'
> make: *** [cyclictest.o] Error 1
> 
> 
> 
> Thank you for any suggestions and help.
> 
> Regards,
> Samuele Forconi.



-- 
Ing. Samuele Forconi
Responsabile Sviluppo SW
WaveComm S.r.l.
Sede legale: Via Donizetti 25, 53011 Castellina in Chianti (SI)
Sede operativa: Loc. Belvedere - Ingresso 2, 53034 Colle Val d'Elsa (SI)
Phone: (39) 0577 043101
Fax: (39) 0577 043101
Mobile: (39) 347 5899717
Skype: samueleforconi
E-mail: forconi@wavecomm.it
URL: www.wavecomm.it

_____________________________________________________________________________________________

Ai sensi del D. Lgs. n.196 del 30/06/2003, questo messaggio ed ogni suo allegato sono confidenziali e ad uso esclusivo del destinatario, il quale è l'unico autorizzato ad usarlo, copiarlo e, sotto la propria responsabilità, diffonderlo. Se il ricevente non è il destinatario diretto del presente messaggio, è pregato di contattare l'originario mittente e di cancellare questo messaggio ed ogni suo allegato dal sistema di posta. Se il ricevente non è il destinatario diretto del presente messaggio, sono vietati l'uso, la riproduzione, e la stampa di questo messaggio e di ogni suo allegato, nonché la diffusione del loro contenuto a qualsiasi altro soggetto.

For the D. Lgs. n.196 of 30/06/2003, this message and any attachment are confidential and privileged for the the recipient identified above, who only may use, copy and, under his/her responsibility, further disseminate it. If you are not the intended recipient, please contact the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not use, copy or print this message or attachment or disclose the contents to any other person.
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: Cyclictest compile error when cross compiling for AT91SAM9260
  2012-09-27  8:23     ` Forconi
@ 2012-09-27 19:02       ` Frank Rowand
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Rowand @ 2012-09-27 19:02 UTC (permalink / raw)
  To: Forconi; +Cc: linux-rt-users@vger.kernel.org

On 09/27/12 01:23, Forconi wrote:
> Hi, 
> I made a cleanup and a fresh clone of the git repository.
> 
> This is what I get running make:
> 
> $ make CC=arm-unknown-linux-gnu-gcc
> src/pi_tests/pip_stress.c:240:2: error: #error _POSIX_THREAD_PROCESS_SHARED is not defined
> src/pi_tests/pi_stress.c:78:2: error: #error "Can't run this test without PI Mutex support"
> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/cyclictest/cyclictest.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
> src/cyclictest/cyclictest.c: In function 'timerthread':
> src/cyclictest/cyclictest.c:700: warning: implicit declaration of function 'pthread_setaffinity_np'
> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/rt-utils.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/error.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
> arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/lib/rt-get_cpu.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2
> ar rcs librttest.a rt-utils.o error.o rt-get_cpu.o
> arm-unknown-linux-gnu-gcc -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2  -o cyclictest cyclictest.o librttest.a -lrt -lpthread -lrttest -L. 
> cyclictest.o: In function `timerthread':
> cyclictest.c:(.text+0x17ac): undefined reference to `pthread_setaffinity_np'
> collect2: ld returned 1 exit status
> make: *** [cyclictest] Error 1
> 
> It seems that the pthread_setaffinity_np is missing in pthread library (maybe I have an old lib?)


These errors look possibly more reasonable than the original errors.  And possibly
just lack of support for the features as you suggest with "maybe I have an old lib".
Another possibility is that your cross tools are not pulling in the right header
files and libraries.


(1) pip_stress.c:240:2: error: #error _POSIX_THREAD_PROCESS_SHARED is not defined

Your environment is missing the feature.  If it existed, _POSIX_THREAD_PROCESS_SHARED
would be defined in the <bits/posix_opt.h> that your cross tools are pulling in.
The include chain is:

   src/pi_tests/pip_stress.c
      src/include/pip_stress.h
         <unistd.h>
            <bits/posix_opt.h>

If you think the header files from your cross tools should define _POSIX_THREAD_PROCESS_SHARED
then you can verify which header file is used for <bits/posix_opt.h> by:

   arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/pi_tests/pip_stress.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2 -C -E >junk_pip_stress
   grep posix_opt.h junk_pip_stress


(2) cyclictest.c:700: warning: implicit declaration of function 'pthread_setaffinity_np'

Your environment is missing the feature.  If it existed, pthread_setaffinity_np() would
be defined in <pthread.h>.  This warning is consistent with your pthread library not
having pthread_setaffinity_np(), which is reported by the link error
"undefined reference to `pthread_setaffinity_np'".

You can verify which header file is used for <pthread.h> by:

   arm-unknown-linux-gnu-gcc -D VERSION_STRING=0.84 -c src/cyclictest/cyclictest.c -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include -O2 -C -E >junk_cyclictest
   grep pthread.h junk_cyclictest

If you think your pthread library should include this feature, then verify which
pthread library the linker is pulling in.

-Frank



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

end of thread, other threads:[~2012-09-27 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1482871759.3943500.1348650924961.JavaMail.root@zmail.sgconsulting.it>
2012-09-26  9:26 ` Cyclictest compile error when cross compiling for AT91SAM9260 Forconi
2012-09-26 19:34   ` Frank Rowand
2012-09-27  8:23     ` Forconi
2012-09-27 19:02       ` Frank Rowand

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).