Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lufa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
lufa
Commits
4641acc6
Commit
4641acc6
authored
12 years ago
by
Dean Camera
Browse files
Options
Downloads
Patches
Plain Diff
Add LINKER_RELAXATIONS option to the LUFA BUILD build system module.
parent
4cd80263
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
LUFA/Build/lufa_build.mk
+23
-15
23 additions, 15 deletions
LUFA/Build/lufa_build.mk
LUFA/DoxygenPages/BuildSystem.txt
+7
-0
7 additions, 0 deletions
LUFA/DoxygenPages/BuildSystem.txt
LUFA/DoxygenPages/LUFAPoweredProjects.txt
+2
-0
2 additions, 0 deletions
LUFA/DoxygenPages/LUFAPoweredProjects.txt
with
32 additions
and
15 deletions
LUFA/Build/lufa_build.mk
+
23
−
15
View file @
4641acc6
...
...
@@ -9,7 +9,7 @@
LUFA_BUILD_MODULES
+=
BUILD
LUFA_BUILD_TARGETS
+=
size symbol-sizes all lib elf hex lss clean mostlyclean
LUFA_BUILD_MANDATORY_VARS
+=
TARGET ARCH MCU SRC F_USB LUFA_PATH
LUFA_BUILD_OPTIONAL_VARS
+=
BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_FLAGS CPP_FLAGS ASM_FLAGS CC_FLAGS LD_FLAGS OBJDIR OBJECT_FILES DEBUG_TYPE DEBUG_LEVEL
LUFA_BUILD_OPTIONAL_VARS
+=
BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_FLAGS CPP_FLAGS ASM_FLAGS CC_FLAGS LD_FLAGS OBJDIR OBJECT_FILES DEBUG_TYPE DEBUG_LEVEL
LINKER_RELAXATIONS
LUFA_BUILD_PROVIDED_VARS
+=
LUFA_BUILD_PROVIDED_MACROS
+=
...
...
@@ -60,6 +60,9 @@ LUFA_BUILD_PROVIDED_MACROS +=
# CC_FLAGS - Common flags to pass to the C/C++ compiler and
# assembler
# LD_FLAGS - Flags to pass to the linker
# LINKER_RELAXATIONS - Enable or disable linker relaxations to
# decrease binary size (note: can cause link
# failures on systems with an unpatched binutils)
# OBJDIR - Directory for the output object and dependency
# files; if equal to ".", the output files will
# be generated in the same folder as the sources
...
...
@@ -99,6 +102,7 @@ OBJDIR ?= .
OBJECT_FILES
?=
DEBUG_FORMAT
?=
dwarf-2
DEBUG_LEVEL
?=
2
LINKER_RELAXATIONS
?=
Y
# Sanity check user supplied values
$(
foreach
MANDATORY_VAR,
$(
LUFA_BUILD_MANDATORY_VARS
)
,
$(
call ERROR_IF_UNSET,
$(
MANDATORY_VAR
)))
...
...
@@ -114,6 +118,7 @@ $(call ERROR_IF_EMPTY, CPP_STANDARD)
$(
call
ERROR_IF_EMPTY, OBJDIR
)
$(
call
ERROR_IF_EMPTY, DEBUG_FORMAT
)
$(
call
ERROR_IF_EMPTY, DEBUG_LEVEL
)
$(
call
ERROR_IF_NONBOOL, LINKER_RELAXATIONS
)
# Determine the utility prefix to use for the selected architecture
ifeq
($(ARCH), AVR8)
...
...
@@ -194,7 +199,10 @@ BASE_CPP_FLAGS := -x c++ -O$(OPTIMIZATION) -std=$(CPP_STANDARD)
BASE_ASM_FLAGS
:=
-x
assembler-with-cpp
# Create a list of flags to pass to the linker
BASE_LD_FLAGS
:=
-lm
-Wl
,-Map
=
$(
TARGET
)
.map,--cref
-Wl
,--gc-sections
-Wl
,--relax
BASE_LD_FLAGS
:=
-lm
-Wl
,-Map
=
$(
TARGET
)
.map,--cref
-Wl
,--gc-sections
ifeq
($(LINKER_RELAXATIONS), Y)
BASE_LD_FLAGS
+=
-Wl
,--relax
endif
ifeq
($(ARCH), AVR8)
BASE_LD_FLAGS
+=
-mmcu
=
$(
MCU
)
else
ifeq
($(ARCH), XMEGA)
...
...
This diff is collapsed.
Click to expand it.
LUFA/DoxygenPages/BuildSystem.txt
+
7
−
0
View file @
4641acc6
...
...
@@ -188,6 +188,13 @@
* <td>Flags to pass to the linker, after the automatically generated flags.</td>
* </tr>
* <tr>
* <td><tt>LINKER_RELAXATIONS</tt></td>
* <td>Enables or disables linker relaxations when linking the application binary. This can reduce the total size
* of the application by replacing full \c CALL instructions with smaller \c RCALL instructions where possible.
* \note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you
* receive a link error <tt>relocation truncated to fit: R_AVR_13_PCREL</tt>, disable this setting.</td>
* </tr>
* <tr>
* <td><tt>OBJDIR</tt></td>
* <td>Directory to place the generated object and dependency files. If set to "." the same folder as the source file will be used.
* \note When this option is enabled, all source filenames <b>must</b> be unique.</td>
...
...
This diff is collapsed.
Click to expand it.
LUFA/DoxygenPages/LUFAPoweredProjects.txt
+
2
−
0
View file @
4641acc6
...
...
@@ -148,6 +148,7 @@
* \li CFFA3000, a CompactFlash interface for the Apple II: http://www.dreher.net/CFforAppleII
* \li Digital Survey Instruments Magnetometer and Pointer: http://www.digitalsurveyinstruments.com/
* \li FinchRobot, a robot designed for educational use: http://www.finchrobot.com/
* \li Flysight, a GPS logger for wingsuit pilots: http://flysight.ca/
* \li HummingBird Kit, a robotics learning platform: http://www.hummingbirdkit.com/
* \li Penguino, an Arduino Board With On-Board LUFA Powered Debugger/Programmer: http://wiki.icy.com.au/PenguinoAVR
* \li PIR-1, an IR control interface for consumer electronics: http://www.promixis.com/pir-1.php
...
...
@@ -160,6 +161,7 @@
* \li Retrode, a USB Games Console Cartridge Reader: http://www.retrode.org
* \li RFI21.1EU UHF RFID reader: http://www.metra.cz/rfid/uhf-rfid-ctecky/rfi21-1eu-uhf-rfid-ctecka.htm
* \li SmartCardDetective, a Smart Card analysis tool: http://www.smartcarddetective.com/
* \li TimelapsePlus, a digital camera time lapse tool: https://github.com/timelapseplus/TimelapsePlus-Firmware
* \li USBTINY-MKII, an AVRISP-MKII Clone AVR Programmer: http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
* \li UDS18B20 USB Temperature sensor: http://toughlog.org/uds18b20/
* \li VMeter, a USB MIDI touch strip controller: http://www.vmeter.net/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment