ppc64 cross-compiler on iSeries and stat()

Justin Banks justinb at constantdata.com
Mon Mar 29 06:10:28 EST 2004


Marcus Meissner wrote
> On Sat, Mar 27, 2004 at 09:22:44AM -0600, Justin Banks wrote:
> >
> > Steve Munroe wrote
> > >
> > > Which Distro? Which Service Pack?
> >
> > SuSE SLES 8, Kernel 2.4.21-111-iseries64
>
> Versions of:
> 	cross-ppc64-glibc
> 	glibc

Hopefully this is what you're after :

[root at PW840L02 root]# rpm -qa | grep glibc
glibc-2.2.5-139
glibc-64bit-8.1-69
glibc-devel-2.2.5-139
glibc-locale-2.2.5-139
cross-ppc64-glibc-2.2.5-82

Additionally, here's something else I discovered :

[root at PW840L02 root]# cat foo3.c
#include <stdio.h>
#include <pthread.h>

void *foo(void *x)
{
	while(1) {
		printf("here I am\n");
		sleep(5);
	}
	return NULL;
}

int
main(void)
{
	pthread_attr_t a;
	pthread_t t;

	pthread_attr_init(&a);
	pthread_attr_setstacksize(&a, 65536);
	pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED);
	pthread_create(&t, &a, foo, NULL);

	while (1) {
		printf("do de da\n");
		sleep(3);
	}
	exit(0);
}

[root at PW840L02 root]# gcc foo3.c -o foo3 -lpthread
[root at PW840L02 root]# ./foo3
here I am
do de da

[root at PW840L02 root]# gcc foo3.c -o foo3 -static -lpthread
[root at PW840L02 root]# ./foo3
here I am
do de da

[root at PW840L02 root]# powerpc64-linux-gcc foo3.c -o foo3 -lpthread
[root at PW840L02 root]# ./foo3
here I am
do de da

[root at PW840L02 root]# powerpc64-linux-gcc foo3.c -o foo3 -static -lpthread
[root at PW840L02 root]# ./foo3
Segmentation fault

Any application statically linked against libpthread and compiled with the
cross-compiler SEGVs in libc_internal_tsd_set()

-justinb

--
Justin Banks
Constant Data, Inc.
http://www.constantdata.com

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list