Issue with RTEMS 4.12 compiler include path

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jun 23 13:26:06 UTC 2016


This time with an attachment...

On 23/06/16 15:25, Sebastian Huber wrote:
> On 23/06/16 15:17, Harwell, John R. wrote:
>> Thanks Sebastian--I have updated my Makefile. I'm still having 
>> problems with the compiler builtin include path when building though. 
>> I've been poking around the RSB configuration, but cannot figure out 
>> how to add an additional system include directory when building the 
>> compiler. I looked at the logs, and the '--with-sysroot=' option 
>> looked like it might be what I wanted, but passing it to the 
>> toolchain build process did not have any effect. Do you have any 
>> ideas there?
>
> I use the attached Makefile for simple programs. There is waf support 
> for RTEMS applications, which is probably the better alternative.
>
> I would not build a special GCC for such purposes.
>

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

-------------- next part --------------
RTEMS_API = 4.12
RTEMS_CPU = powerpc
RTEMS_BSP = qoriq_t4240rdb

prefix = /opt/rtems-$(RTEMS_API)
exec_prefix = $(prefix)/$(RTEMS_CPU)-rtems$(RTEMS_API)

RTEMS_ROOT = $(prefix)
RTEMS_SHARE = $(RTEMS_ROOT)/share/rtems$(RTEMS_API)
PROJECT_ROOT = $(prefix)/$(RTEMS_CPU)-rtems$(RTEMS_API)/$(RTEMS_BSP)
PROJECT_INCLUDE = $(PROJECT_ROOT)/lib/include
PROJECT_LIB = $(PROJECT_ROOT)/lib
BUILDDIR = b-$(RTEMS_BSP)

include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg

DEPFLAGS = -MT $@ -MD -MP -MF $(basename $@).d
SYSFLAGS = -B $(PROJECT_LIB) -specs bsp_specs -qrtems
WARNFLAGS = -Wall -Wextra -Wconversion -Wstrict-prototypes -Wformat-security -Wformat=2 -Wshadow -Wbad-function-cast -Wcast-qual -Wcast-align -Wredundant-decls
OPTFLAGS = -O2 -g -ffunction-sections -fdata-sections

CFLAGS = $(DEPFLAGS) $(SYSFLAGS) $(WARNFLAGS) $(CPU_CFLAGS) $(OPTFLAGS)
CXXFLAGS = $(DEPFLAGS) $(SYSFLAGS) $(WARNFLAGS) $(CPU_CFLAGS) $(OPTFLAGS)
ASFLAGS = $(CPU_CFLAGS)
LDFLAGS = -Wl,--gc-sections

EXEEXT = .exe
DOWNEXT = .ralf

LINKFLAGS = $(SYSFLAGS) $(CPU_CFLAGS) $(LDFLAGS) $(OPTFLAGS)
CCLINK = $(CC) $(LINKFLAGS) -Wl,-Map,$(basename $@).map
CXXLINK = $(CXX) $(LINKFLAGS) -Wl,-Map,$(basename $@).map

$(BUILDDIR)/%.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

$(BUILDDIR)/%.o: %.S
	$(CC) $(CPPFLAGS) -DASM $(CFLAGS) -c $< -o $@

$(BUILDDIR)/%.o: %.cc
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

$(BUILDDIR)/%.o: %.cpp
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

$(BUILDDIR)/%.o: %.s
	$(AS) $(ASFLAGS) $< -o $@

export PATH := $(prefix)/bin:$(PATH)

export AR = $(RTEMS_CPU)-rtems$(RTEMS_API)-ar
export AS = $(RTEMS_CPU)-rtems$(RTEMS_API)-as
export CC = $(RTEMS_CPU)-rtems$(RTEMS_API)-gcc --pipe
export CXX = $(RTEMS_CPU)-rtems$(RTEMS_API)-g++
export LD = $(RTEMS_CPU)-rtems$(RTEMS_API)-ld
export NM = $(RTEMS_CPU)-rtems$(RTEMS_API)-nm
export OBJCOPY = $(RTEMS_CPU)-rtems$(RTEMS_API)-objcopy
export RANLIB = $(RTEMS_CPU)-rtems$(RTEMS_API)-ranlib
export SIZE = $(RTEMS_CPU)-rtems$(RTEMS_API)-size
export STRIP = $(RTEMS_CPU)-rtems$(RTEMS_API)-strip

APP = $(BUILDDIR)/app
APP_PIECES = init
APP_OBJS = $(APP_PIECES:%=$(BUILDDIR)/%.o)
APP_DEPS = $(APP_PIECES:%=$(BUILDDIR)/%.d)

all: $(BUILDDIR) $(APP).img

$(BUILDDIR):
	mkdir $(BUILDDIR)

$(APP)$(EXEEXT): $(APP_OBJS)
	$(CXXLINK) $^ -o $@
	$(bsp-post-link)

$(BUILDDIR)/app.bin: $(APP)$(EXEEXT)
	$(OBJCOPY) -O binary $^ $@

$(BUILDDIR)/app.bin.gz: $(BUILDDIR)/app.bin
	gzip -9 -f -c $^ > $@

$(BUILDDIR)/app.img: $(BUILDDIR)/app.bin.gz
	mkimage -A ppc -O rtems -T kernel -a 0x0 -e 0x4000 -n RTEMS -d $^ $@ 1>/dev/null

clean:
	rm -rf $(BUILDDIR)

-include $(APP_DEPS)


More information about the users mailing list