View Issue Details

IDProjectCategoryView StatusLast Update
0031594LazarusPackagespublic2020-07-18 00:02
Reporterrusty_robot Assigned To 
Status newResolutionopen 
Summary0031594: Cross-compilng a package: "Conflicting CPU architectures" error
DescriptionI have tried to use a runtime-only package in arm-embedded project. The lpk does not contain any custom settings - basically just a container for units. However when I try to compile my project, I'm getting "Conflicting CPU architectures 13/1" error.
Steps To ReproduceI've attached an example which contains "app" project and "pkg" package (note that the app.lpi has hardcoded paths to "/usr/local/src/fpc-3.1.1").
Provided that you have arm-embedded toolchain and ppcrossarm, you can just run "lazbuild app.lpi".
I did not try to cross-compile on any other platforms
Additional InformationLog (ignore the link warnings)

$ lazbuild app.lpi
Info: (lazarus) Execute Title="Compile Project, OS: embedded, CPU: arm, Target: app"
Info: (lazarus) Working Directory="/home/user/code/crosspkg/"
Info: (lazarus) Executable="/usr/local/lib/fpc/3.1.1/ppcrossarm"
Info: (lazarus) Param[0]="-Tembedded"
Info: (lazarus) Param[1]="-Parm"
Info: (lazarus) Param[2]="-MObjFPC"
Info: (lazarus) Param[3]="-Scghi"
Info: (lazarus) Param[4]="-O1"
Info: (lazarus) Param[5]="-l"
Info: (lazarus) Param[6]="-vewnhibq"
Info: (lazarus) Param[7]="-Fi/home/user/code/crosspkg/lib/arm-embedded"
Info: (lazarus) Param[8]="-Fi/usr/local/src/fpc-3.1.1/fpc/rtl/embedded/arm"
Info: (lazarus) Param[9]="-Fu/usr/local/src/fpc-3.1.1/fpc/rtl/embedded/arm"
Info: (lazarus) Param[10]="-Fu/home/user/code/crosspkg/pkg/lib/arm-embedded"
Info: (lazarus) Param[11]="-Fu/home/user/code/crosspkg/"
Info: (lazarus) Param[12]="-FU/home/user/code/crosspkg/lib/arm-embedded/"
Info: (lazarus) Param[13]="-Cparmv7m"
Info: (lazarus) Param[14]="app.lpr"
Hint: (11030) Start of reading config file /etc/fpc.cfg
Hint: (11031) End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 3.1.1 [2016/06/27] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
(1002) Target OS: Embedded
(3104) Compiling app.lpr
/home/user/code/crosspkg/app.lpr(3,6) Hint: (5023) Unit "pkg_utils" not used in app
(9009) Assembling app
/usr/bin/arm-embedded-ld:link.res:25: warning: memory region `ram' not declared
/usr/bin/arm-embedded-ld: error: ./pkg/lib/arm-embedded/pkg_utils.o: Conflicting CPU architectures 13/1 <-----
/usr/bin/arm-embedded-ld: failed to merge target specific data of file ./pkg/lib/arm-embedded/pkg_utils.o <-----
/usr/bin/arm-embedded-ld: app.elf: warning: allocated section `.data' not in segment
(9015) Linking app
app.lpr(11) Error: (9013) Error while linking
app.lpr(11) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: (lazarus) Compile Project, OS: embedded, CPU: arm, Target: app: stopped with exit code 256
ERROR: failed compiling of project /home/user/code/crosspkg/app.lpi

$ file ./pkg/lib/arm-embedded/pkg_utils.o
./pkg/lib/arm-embedded/pkg_utils.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped

$ file ./lib/arm-embedded/app.o
./lib/arm-embedded/app.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped
TagsNo tags attached.
Fixed in Revision
Attached Files


related to 0029928 assignedMattias Gaertner Project Options - Additions and Overrides - Set LCLWidgetType overrides Tools - Configure "Build Lazarus" - LCL widget type 



2017-03-24 18:44

reporter (5,445 bytes)

Thaddy de Koning

2017-03-24 18:51

reporter   ~0099201

Last edited: 2017-03-24 18:54

View 3 revisions

I do not see a SUBARCH specified?


2017-03-25 09:47

reporter   ~0099217

Those are options for building FPC, not application, aren't they? For the application I do have -Cparmv7m

Issue History

Date Modified Username Field Change
2017-03-24 18:44 rusty_robot New Issue
2017-03-24 18:44 rusty_robot File Added:
2017-03-24 18:51 Thaddy de Koning Note Added: 0099201
2017-03-24 18:53 Thaddy de Koning Note Edited: 0099201 View Revisions
2017-03-24 18:54 Thaddy de Koning Note Edited: 0099201 View Revisions
2017-03-24 22:45 Florian Project FPC => Lazarus
2017-03-25 09:47 rusty_robot Note Added: 0099217
2020-07-18 00:02 Juha Manninen Relationship added related to 0029928