Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm-none-eabi-ld: cannot find -lc #14

Open
ajaybolloju opened this issue Feb 27, 2018 · 2 comments
Open

arm-none-eabi-ld: cannot find -lc #14

ajaybolloju opened this issue Feb 27, 2018 · 2 comments

Comments

@ajaybolloju
Copy link

when i type 'make' and enter, following error appears

Dark Builder - Unified Build Environment
Version (1.0.0 - Armstrong)
[CC] [RaspberryPi BSP] port.o
/home/ajay/RaspberryPi-FreeRTOS/FreeRTOS/Source/portable/GCC/RaspberryPi/port.c: In function 'vTickISR':
/home/ajay/RaspberryPi-FreeRTOS/FreeRTOS/Source/portable/GCC/RaspberryPi/port.c:221:29: warning: unused parameter 'nIRQ' [-Wunused-parameter]
void vTickISR (unsigned int nIRQ, void *pParam)
^
/home/ajay/RaspberryPi-FreeRTOS/FreeRTOS/Source/portable/GCC/RaspberryPi/port.c:221:41: warning: unused parameter 'pParam' [-Wunused-parameter]
void vTickISR (unsigned int nIRQ, void *pParam)
^
/home/ajay/RaspberryPi-FreeRTOS/FreeRTOS/Source/portable/GCC/RaspberryPi/port.c: In function 'prvSetupTimerInterrupt':
/home/ajay/RaspberryPi-FreeRTOS/FreeRTOS/Source/portable/GCC/RaspberryPi/port.c:237:16: warning: variable 'ulCompareMatch' set but not used [-Wunused-but-set-variable]
unsigned long ulCompareMatch;
^
[CC] [RaspberryPi BSP] portisr.o
[CC] [RaspberryPi BSP] croutine.o
[CC] [RaspberryPi BSP] list.o
[CC] [RaspberryPi BSP] queue.o
[CC] [RaspberryPi BSP] tasks.o
[CC] [RaspberryPi BSP] irq.o
[CC] [RaspberryPi BSP] gpio.o
[CC] [RaspberryPi BSP] heap_4.o
[AS] [RaspberryPi BSP] startup.o
[CC] [RaspberryPi BSP] main.o
/home/ajay/RaspberryPi-FreeRTOS/Demo/main.c: In function 'task1':
/home/ajay/RaspberryPi-FreeRTOS/Demo/main.c:74:18: warning: unused parameter 'pParam' [-Wunused-parameter]
void task1(void *pParam) {
^
/home/ajay/RaspberryPi-FreeRTOS/Demo/main.c: In function 'task2':
/home/ajay/RaspberryPi-FreeRTOS/Demo/main.c:84:18: warning: unused parameter 'pParam' [-Wunused-parameter]
void task2(void *pParam) {
^
/home/ajay/RaspberryPi-FreeRTOS/Demo/main.c: At top level:
/home/ajay/RaspberryPi-FreeRTOS/Demo/main.c:102:6: warning: return type of 'main' is not 'int' [-Wmain]
void main (void)
^
In file included from /home/ajay/RaspberryPi-FreeRTOS/Demo/main.c:69:0:
/home/ajay/RaspberryPi-FreeRTOS/Demo/main.c: In function 'main':
/home/ajay/RaspberryPi-FreeRTOS/FreeRTOS/Source/include/task.h:284:134: warning: pointer targets in passing argument 2 of 'xTaskGenericCreate' differ in signedness [-Wpointer-sign]
#define xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask ) xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) )
^
/home/ajay/RaspberryPi-FreeRTOS/Demo/main.c:106:2: note: in expansion of macro 'xTaskCreate'
xTaskCreate(task1, "LED_0", 128, NULL, 0, NULL);
^
/home/ajay/RaspberryPi-FreeRTOS/FreeRTOS/Source/include/task.h:1282:22: note: expected 'const signed char * const' but argument is of type 'char *'
signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pxTaskCode, const signed char * const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions ) PRIVILEGED_FUNCTION;
^
/home/ajay/RaspberryPi-FreeRTOS/FreeRTOS/Source/include/task.h:284:134: warning: pointer targets in passing argument 2 of 'xTaskGenericCreate' differ in signedness [-Wpointer-sign]
#define xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask ) xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) )
^
/home/ajay/RaspberryPi-FreeRTOS/Demo/main.c:107:2: note: in expansion of macro 'xTaskCreate'
xTaskCreate(task2, "LED_1", 128, NULL, 0, NULL);
^
/home/ajay/RaspberryPi-FreeRTOS/FreeRTOS/Source/include/task.h:1282:22: note: expected 'const signed char * const' but argument is of type 'char *'
signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pxTaskCode, const signed char * const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions ) PRIVILEGED_FUNCTION;
^
arm-none-eabi-ld: cannot find -lc
Makefile:35: recipe for target 'kernel.elf' failed
make: *** [kernel.elf] Error 1

As you suggested, all the python files in .dbuild/pretty are executable and i modified the path of "LDFLAGS" valiable accordingly. Please help me resolve this error

@dashxdr
Copy link

dashxdr commented Dec 10, 2023

Wow, this is an old project. I spent a bit of time trying to get it to build, using a cross compiler I got from ARM's site: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
The file was arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz and I modified dbuild.config.mk's:

TOOLCHAIN=/ram/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-
and Makefile:
kernel.elf: LDFLAGS += -L /ram/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/ -lgcc
#kernel.elf: LDFLAGS += -lc

I got only missing references to memset, memcpy and strncpy so I just added these to
RaspberryPi-FreeRTOS/Demo/main.c just before main:

void *memset(void *s, int c, size_t n) {
char *cp = s;
while(n-->0) *cp++ = c;
return s;
}
void memcpy(void *dest, const void *src, size_t n) {
char *dp = dest, *sp = src;
while(n-->0) *dp++ = *sp++;
return dest;
}
char *strncpy(char *dest, const char *src, size_t n) {
int i;
for(i=0;i<n && src[i];++i) dest[i]=src[i];
if(i<n) dest[i]=0;
return dest;
}

I do "make Q=" in order to NOT hide the commands being executed. It ends up producing kernel.elf, kernel.img and kernel.syms. Not sure what to do with them.

@zhenggennj
Copy link

Please download the kernel.img to a SD card and insert it into a socket on RaspberryPi Model 1B. RaspberryPi will boot from the SD card. Please visit https://github.com/dwelch67/raspberrypi for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants