Illegal instruction error using pthread_create() for MIPS BE

hunold at linuxtv.org hunold at linuxtv.org
Wed Jan 25 15:54:47 UTC 2006


Hi, 

I finally managed to build a toolchain, but not using latest
busybox and uclibc snapshots. 

BR2_mips=y
BR2_ENDIAN="BIG"
BR2_KERNEL_HEADERS_2_4_31=y
BR2_PTHREADS_OLD=y
BR2_BINUTILS_VERSION_2_16_1=y
BR2_GCC_VERSION_3_4_3=y
BR2_SOFT_FLOAT=y
# BR2_PACKAGE_BUSYBOX_SNAPSHOT is not set
# BR2_UCLIBC_VERSION_SNAPSHOT is not set 

I compiled and ran the attached test program, and unfortunately it either
fails with an "Illegal instruction" error or the main() function does not 
get executed further after issuing the pthread_create() call. 

 ---------------------schnipp------------------------
root at 172.16.99.59:~# /mnt/target/a.out
fooIllegal instruction (core dumped)
root at 172.16.99.59:~# /mnt/target/a.out
foo...
 ---------------------schnipp------------------------ 

Are there any know issues with the stable version of uclibc with regard to 
the pthread implementation? 

Should I keep trying to use the snapshot version of uclibc? 

With regard to the pthread implementation, is it important to that the Linux 
kernel headers of the running kernel match exactly with the ones used by 
uclibc? 

CU
Michael. 

 ---------------------schnipp------------------------
#include <stdio.h>
#include <pthread.h> 

void *func(void *arg)
{
	while(1) {
		fprintf(stderr,".");
		sleep(1);
	}
} 


int main(void)
{
	pthread_t thread;
	int ret; 

	fprintf(stderr,"foo");
	ret = pthread_create(&thread, NULL, func, NULL);
	fprintf(stderr,"bar");
	if (ret) {
		fprintf(stderr,"pthread_create() failed\n");
		return 1;
	} 

	while(1) {
		fprintf(stderr,",");
		sleep(1);
	} 

	return 0;
}
 ---------------------schnipp------------------------ 




More information about the uClibc mailing list