[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-dev] Changing toolchain default values via CDT extension point
|
I tried to implement an own toolchain (using 'arm-elf-gcc' instead of 'gcc' (both in Cygwin)) by writing a Plugin using the extension point "org.eclipse.cdt.managedbuilder.core.ManagedBuildInfo" of cdt_2.0.0.
I simply wanted to create a new 'Managed Make C Project' - target with different default values for the tool-chain.
Finally I had this 'plugin.xml':
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
id="at.medek.unc20.eclipse.cdt.develop"
name="UNC20 Developer's Plugin"
version="1.0.0"
provider-name="Medek & Schörner Ges.m.b.H">
<runtime>
<library name="unc20_cdt.jar">
<export name="*"/>
</library>
</runtime>
<requires>
<import plugin="org.eclipse.cdt.managedbuilder.ui"/>
<import plugin="org.eclipse.cdt.managedbuilder.core"/>
</requires>
<extension
id="at.medek.unc20.eclipse.cdt.develop.build"
name="UNC20 CDT Develop Build"
point="org.eclipse.cdt.managedbuilder.core.ManagedBuildInfo">
<target
name="Binary for UNC20 (Cygwin on Windows)"
id="cdt.managedbuild.target.gnu.cygwin.test"
isTest="false"
defaultExtension="elf"
scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGnuWinScannerInfoCollector"
makefileGenerator="org.eclipse.cdt.managedbuilder.makegen.gnu.GnuMakefileGenerator"
isAbstract="false"
binaryParser="org.eclipse.cdt.core.PE"
osList="win32"
parent="cdt.managedbuild.target.gnu">
<configuration
name="Debug"
id="cdt.managedbuild.config.gnu.unc20.cygwin.windows.debug">
<toolReference
command="arm-elf-gcc"
id="cdt.managedbuild.tool.gnu.c.compiler">
<optionReference
defaultValue="gnu.c.optimization.level.none"
id="gnu.c.compiler.option.optimization.level">
</optionReference>
<optionReference
defaultValue="gnu.c.debugging.level.default"
id="gnu.c.compiler.option.debugging.level">
</optionReference>
<optionReference
defaultValue="false"
id="gnu.c.compiler.option.warnings.allwarn">
</optionReference>
<optionReference
defaultValue="-c -mbig-endian -mcpu=arm7tdmi"
id="gnu.c.compiler.option.misc.other">
</optionReference>
</toolReference>
<toolReference
command="arm-elf-gcc"
output="o"
id="cdt.managedbuild.tool.gnu.assembler">
<optionReference
defaultValue="-c -mbig-endian -mcpu=arm7tdmi -Wall"
id="gnu.both.asm.option.flags">
</optionReference>
</toolReference>
<toolReference
outputs="elf"
command="arm-elf-gcc"
id="cdt.managedbuild.tool.gnu.c.linker">
<optionReference
defaultValue="true"
id="gnu.c.link.option.nostart">
</optionReference>
<optionReference
defaultValue="-mbig-endian -mcpu=arm7tdmi -L.. -Tdebug.ld"
id="gnu.c.link.option.ldflags">
</optionReference>
</toolReference>
</configuration>
<configuration
name="Release"
id="cdt.managedbuild.config.gnu.unc20.cygwin.windows.release">
<toolReference
command="arm-elf-gcc"
id="cdt.managedbuild.tool.gnu.c.compiler">
<optionReference
defaultValue="gnu.c.optimization.level.none"
id="gnu.c.compiler.option.optimization.level">
</optionReference>
<optionReference
defaultValue="gnu.c.debugging.level.default"
id="gnu.c.compiler.option.debugging.level">
</optionReference>
<optionReference
defaultValue="false"
id="gnu.c.compiler.option.warnings.allwarn">
</optionReference>
<optionReference
defaultValue="-mbig-endian -mcpu=arm7tdmi"
id="gnu.c.compiler.option.misc.other">
</optionReference>
</toolReference>
<toolReference
command="arm-elf-gcc"
output="o"
id="cdt.managedbuild.tool.gnu.assembler">
<optionReference
defaultValue="-c -mbig-endian -mcpu=arm7tdmi -Wall"
id="gnu.both.asm.option.flags">
</optionReference>
</toolReference>
<toolReference
outputs="elf"
command="arm-elf-gcc"
id="cdt.managedbuild.tool.gnu.c.linker">
<optionReference
defaultValue="true"
id="gnu.c.link.option.nostart">
</optionReference>
<optionReference
defaultValue="-mbig-endian -mcpu=arm7tdmi -L.. -Trelease.ld"
id="gnu.c.link.option.ldflags">
</optionReference>
</toolReference>
</configuration>
<toolReference
id="cdt.managedbuild.tool.gnu.c.linker">
</toolReference>
</target>
</extension>
</plugin>
The corresponding UI-toolchain was exactly what I wanted, but it did not work correctly.
My files were:
init.S
main.c
release.ld
debug.ld
My build output for the 'Debug' configuration was:
**** Incremental build of configuration Debug for project test2 ****
make -k all
Building file: ../main.c
arm-elf-gcc -O0 -g -c -mbig-endian -mcpu=arm7tdmi -o main.o ../main.c Finished building: ../main.c
Building file: ../init.S
arm-elf-gcc -c -mbig-endian -mcpu=arm7tdmi -Wall -o init.o ../init.S Finished building: ../init.S
Building target: test2.elf
null null test2.elf main.o init.o
make: null: Command not found
make: *** [test2.elf] Error 127
make: Target `all' not remade because of errors.
Build complete for project test2
Finally I was able to find a workaround for this problem. In the 'Properties'/'C/C++ Build' project folder I pressed the button 'Restore Defaults' and it worked. (see below)
**** Incremental build of configuration Debug for project test2 ****
make -k all
Building target: test2.elf
arm-elf-gcc -nostartfiles -mbig-endian -mcpu=arm7tdmi -L.. -Tdebug.ld -o test2.elf main.o init.o
Finished building: test2.elf
Build complete for project test2
In this case the initial values of the tool-chain seemed to be not identical with the 'default' values.
The same problem happened with the 'release' configuration. The workaround is the same.
Is there something wrong with my 'plugin.xml'?