Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » arm-linux cross compile under Ubuntu fails helloworld.cpp(Need help configuring tool chain (or getting the RIGHT one) in Eclipse)
arm-linux cross compile under Ubuntu fails helloworld.cpp [message #1440619] Wed, 08 October 2014 16:01
Jeff Andle is currently offline Jeff AndleFriend
Messages: 1
Registered: October 2014
Junior Member
My question here straddles Ubuntu, Eclipse, and arm-linux-gcc. The Eclipse end of it is "What are the right workspace settings?" and "is it using the right toolchain?"

If I can get some help with the Eclipse and GCC issues I'll be well and on my way. If not, some suggestions on where to ask next would be welcome (yes, tell me where to go :) ). If anyone wants to backfill the Ubuntu questions (asked on their forum): The Ubuntu end of it is, "What is the correct GCC build to cross compile for Arm 9 920T chip target on 64 bit Ubuntu?" and "How do I get it if apt-get thinks a 2012 build is the most recent package?"

If my problem is purely in Gnu CC I am going there Gnext.

First I am pretty new to Linux but have quite a bit of embedded experience (back to 8080's through to PIC and TMS320) using Winows tools. I am also pretty new to Eclipse, but MPLAB-X and Code Composer Studio are both based on it, so it is growing on me. I've successfully used this system (Ubuntu/Eclipse/arm-linux-GCC) on some MOXA hardware but they provided a complete, pre-built tool chain and a beta Eclipse plug-in that works OK...

Now I am trying to port this C code to a different vendor's HW and also to bring in Qt (so adding C++ to the C) and I need to "roll my own" tool chain. The processor is a SAMSUNG S3C2440A-40, ARM 9 Series (920T).

I am running Ubuntu under VirtualBox:
Linux jandle-VirtualBox 3.13.0-34-generic #60-Ubuntu SMP Wed Aug 13 15:45:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"

I am using Eclipse Luna 4.4.0 with
GNU ARM C/C++ Cross Compiler Support 1.10.2.201407190854 ilg.gnuarmeclipse.managedbuild.cross.feature.group Liviu Ionescu
and
C/C++ GCC Cross Compiler Support 8.3.0.dist org.eclipse.cdt.build.crossgcc.feature.group Eclipse CDT


I installed the Ubuntu release of 4.7 GCC (from 2012?) sudo apt-get install gcc-arm-linux-gnueabi

I created a Hello World.cpp in Eclipse. The code is unmodified.
The project ARM family is arm920t and architecture is toolchain default (could not figure out which to select).
The toolchain is ARM (AArch32) arm-linux-gnueabi- (gcc for C and cpp for C++)

I get build errors:
Building file: ../src/main.cpp
Invoking: Cross ARM C++ Compiler
arm-linux-gnueabi-cpp -mcpu=arm920t -marm -mfloat-abi=soft -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wuninitialized -Wconversion -Wpadded -Wfloat-equal -g3 -I/usr/arm-linux-gnueabi/include -std=gnu++11 -fabi-version=0 -Wsign-promo -MMD -MP -MF"src/main.d" -MT"src/main.o" -c -o "src/main.o" "../src/main.cpp"
arm-linux-gnueabi-cpp: fatal error: '-c' is not a valid option to the preprocessor compilation terminated.
make: *** [src/main.o] Error 4


Makefile (auto)
################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here -include sources.mk -include src/subdir.mk -include subdir.mk -include objects.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(ASM_DEPS)),)
-include $(ASM_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
ifneq ($(strip $(S_UPPER_DEPS)),)
-include $(S_UPPER_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables SECONDARY_SIZE += \ hello-CuTie.siz \


# All Target
all: hello-CuTie.elf secondary-outputs

# Tool invocations
hello-CuTie.elf: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross ARM C++ Linker'
arm-linux-gnueabi-cpp -mcpu=arm920t -marm -mfloat-abi=soft -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wuninitialized -Wconversion -Wpadded -Wfloat-equal -g3 -Xlinker --gc-sections -L/usr/arm-linux-gnueabi/lib -Wl,-Map,"hello-CuTie.map" --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lc -lm -lrdimon -Wl,--end-group -o "hello-CuTie.elf" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '

hello-CuTie.siz: hello-CuTie.elf
@echo 'Invoking: Cross ARM GNU Print Size'
arm-linux-gnueabi-size --format=berkeley "hello-CuTie.elf"
@echo 'Finished building: $@'
@echo ' '

# Other Targets
clean:
-$(RM) $(SECONDARY_SIZE)$(C++_DEPS)$(OBJS)$(C_DEPS)$(ASM_DEPS)$(CC_DEPS)$(CPP_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS)$(S_UPPER_DEPS) hello-CuTie.elf
-@echo ' '

secondary-outputs: $(SECONDARY_SIZE)

.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets

Previous Topic:Not all variables available in Make Target View
Next Topic:Eclipse Luna, CDT, gdb issues with breakpoints
Goto Forum:
  


Current Time: Fri Apr 26 09:48:23 GMT 2024

Powered by FUDForum. Page generated in 0.02788 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top