Note that there are some explanatory texts on larger screens.

plurals
  1. POgcc - How to remove all absolute path from static library output (.a)
    text
    copied!<p>I am using GCC for ARM (<a href="http://www.code-red-tech.com/red-suite-4-nxp.php" rel="nofollow">Red Suite 4 NXP</a>). I am compiling static library files (.a) that are used for a final application. I need to configure the project so any developer can produce the exact same static library output. (This is mainly so a new developer can verify they have their setup correct.) I have two copies of my project (two checkouts from SVN). When I build with each, I notice some absolute path information in the static library .a output files. This means that SVN detects as a change. I'm using the ar -D (deterministic) option already. Are there any other options to remove path information? I tried gcc -s but this didn't work (it appears this is only for final executable, not libraries)</p> <p>I don't know where/why the absolute paths are in the .a, but I can provide more information if someone can point me in the right direction. </p> <p>I've looked at the strip utility man pages (haven't tried it yet), would this remove this path information?</p> <p>Also, I am using Red Suite to manage the project, so I'm trying to do things the Red Suite way (and to let it do its thing). However, if there is a gcc or ar option I need to adjust, I do know how to do that. I just don't know what option to change.</p> <p>Here is the build console output. This causes the absolute path of my project to be included into the resulting .a. That is what I am trying to fix.</p> <pre><code>**** Build of configuration Release for project lib_touch **** make -j all Building file: C:/Users/my_user_name/Documents/My Project Verification build/src/touch/Touch.c Building file: C:/Users/my_user_name/Documents/My Project Verification build/src/touch/TouchCalibration.c Building file: C:/Users/my_user_name/Documents/My Project Verification build/src/touch/TouchPoint.c Building file: C:/Users/my_user_name/Documents/My Project Verification build/src/touch/TouchEventQueue.c Invoking: MCU C Compiler Invoking: MCU C Compiler arm-none-eabi-gcc -D__REDLIB__ -DNDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC177x_8x -I"C:\Users\my_user_name\Documents\My Project Verification build\src\build\RedSuite4NXP\CMSISv2p00_LPC177x_8x\inc" -I../../../../board -I../../../../board/lpc1788 -I../../../../communication -I../../../../events -I../../../../geometry -I../../../../graphics -I../../../../hmilogic/include -I../../../../sound -I../../../../util -O3 -Wall -Werror -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -std=gnu99 -mcpu=cortex-m3 -mthumb -MMD -MP -MF"touch/Touch.d" -MT"touch/Touch.d" -o"touch/Touch.o" "C:/Users/my_user_name/Documents/My Project Verification build/src/touch/Touch.c" arm-none-eabi-gcc -D__REDLIB__ -DNDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC177x_8x -I"C:\Users\my_user_name\Documents\My Project Verification build\src\build\RedSuite4NXP\CMSISv2p00_LPC177x_8x\inc" -I../../../../board -I../../../../board/lpc1788 -I../../../../communication -I../../../../events -I../../../../geometry -I../../../../graphics -I../../../../hmilogic/include -I../../../../sound -I../../../../util -O3 -Wall -Werror -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -std=gnu99 -mcpu=cortex-m3 -mthumb -MMD -MP -MF"touch/TouchCalibration.d" -MT"touch/TouchCalibration.d" -o"touch/TouchCalibration.o" "C:/Users/my_user_name/Documents/My Project Verification build/src/touch/TouchCalibration.c" Invoking: MCU C Compiler Invoking: MCU C Compiler arm-none-eabi-gcc -D__REDLIB__ -DNDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC177x_8x -I"C:\Users\my_user_name\Documents\My Project Verification build\src\build\RedSuite4NXP\CMSISv2p00_LPC177x_8x\inc" -I../../../../board -I../../../../board/lpc1788 -I../../../../communication -I../../../../events -I../../../../geometry -I../../../../graphics -I../../../../hmilogic/include -I../../../../sound -I../../../../util -O3 -Wall -Werror -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -std=gnu99 -mcpu=cortex-m3 -mthumb -MMD -MP -MF"touch/TouchEventQueue.d" -MT"touch/TouchEventQueue.d" -o"touch/TouchEventQueue.o" "C:/Users/my_user_name/Documents/My Project Verification build/src/touch/TouchEventQueue.c" Finished building: C:/Users/my_user_name/Documents/My Project Verification build/src/touch/Touch.c arm-none-eabi-gcc -D__REDLIB__ -DNDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC177x_8x -I"C:\Users\my_user_name\Documents\My Project Verification build\src\build\RedSuite4NXP\CMSISv2p00_LPC177x_8x\inc" -I../../../../board -I../../../../board/lpc1788 -I../../../../communication -I../../../../events -I../../../../geometry -I../../../../graphics -I../../../../hmilogic/include -I../../../../sound -I../../../../util -O3 -Wall -Werror -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -std=gnu99 -mcpu=cortex-m3 -mthumb -MMD -MP -MF"touch/TouchPoint.d" -MT"touch/TouchPoint.d" -o"touch/TouchPoint.o" "C:/Users/my_user_name/Documents/My Project Verification build/src/touch/TouchPoint.c" Finished building: C:/Users/my_user_name/Documents/My Project Verification build/src/touch/TouchEventQueue.c Finished building: C:/Users/my_user_name/Documents/My Project Verification build/src/touch/TouchCalibration.c Finished building: C:/Users/my_user_name/Documents/My Project Verification build/src/touch/TouchPoint.c Building target: lib_touch.a Invoking: MCU Archiver arm-none-eabi-ar -rD "lib_touch.a" ./touch/Touch.o ./touch/TouchCalibration.o ./touch/TouchEventQueue.o ./touch/TouchPoint.o c:\code_red\RedSuiteNXP_4.3.0_1033\redsuite\tools\bin\arm-none-eabi-ar.exe: creating lib_touch.a Finished building target: lib_touch.a make --no-print-directory post-build Performing post-build steps arm-none-eabi-size "lib_touch.a" ; cp "lib_touch.a" "../../../../lib/lib_touch.a"; # arm-none-eabi-objdump -h -S "lib_touch.a" &gt;"lib_touch.lss" text data bss dec hex filename 1864 0 156 2020 7e4 Touch.o (ex lib_touch.a) 576 0 0 576 240 TouchCalibration.o (ex lib_touch.a) 320 0 0 320 140 TouchEventQueue.o (ex lib_touch.a) 96 0 0 96 60 TouchPoint.o (ex lib_touch.a) </code></pre> <p>UPDATE: MORE INFORMATION</p> <p>I have done some more digging, and it appears the full file path is in front of a string constant. The path data within the .a file shows </p> <pre><code>C:/Users/my_user_name/Documents/My Project Verification build/src/touch/Touch.c.TouchIdleTimer </code></pre> <p>I have a string literal "TouchIdleTimer" within the file Touch.c. Is this the cause? How would I remove the path portion, or is it possible? TIA</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload