Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21332 Discussions

Object file creation error during build

Altera_Forum
Honored Contributor II
1,260 Views

Im using the 9.1 version of the Nios tool and when I include one assembly source file and try to build my project, I notice the corresponding object file is not being created. Therefore I am getting undefined reference errors for the functions I have made in the source file. Im using the correct extension (.S) so I cant seem to figure out whats going on. Anyone else run into a similar problem?

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
518 Views

We're seeing the same problem. It looks like the IDE is not adding the assembly files to the ASM_SRCS variable in the application makefile. I'm calling it a bug at this point. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
518 Views

Figured out the solution. Apparently the extension is case sensitive so if you rename you file to xxx.s instead of xxx.S, it should build properly.

0 Kudos
Altera_Forum
Honored Contributor II
518 Views

I do not agree with your workaround. 

 

It may certainly work for pure assembly, but not assembly code that must be pre-processed by the C pre-processor. 

 

Indeed, the fundamental difference between a .s and a .S file is the implicit pre-processing stage of the .S file to include files with# include directives and conditionally include code with# if/#ifdef/(etc...) directives. 

 

See gcc manual, chapter "3.2 Options Controlling the Kind of Output" : 

file.s Assembler code. 

file.S Assembler code which must be preprocessed. 

 

I therefore do also consider this to be a bug.
0 Kudos
Reply