Skip to content

Enable xcc build for all platform - #2024

Merged
tlauda merged 5 commits into
thesofproject:masterfrom
xiulipan:pr/xccbuild
Nov 26, 2019
Merged

Enable xcc build for all platform#2024
tlauda merged 5 commits into
thesofproject:masterfrom
xiulipan:pr/xccbuild

Conversation

@xiulipan

@xiulipanxiulipan commented Oct 30, 2019

Copy link
Copy Markdown
Contributor

Fix xcc build for BYT/CHT/HSW/BDW/SUE
Improve the optimization level to reduce TEXT size in FW.
Fix void pointer arithmetic in hifi2 build.
Update xcc build config for all existing platforms.

@xiulipan

Copy link
Copy Markdown
ContributorAuthor

@jajanusz@tlauda Could you help to check the build fail for the BYT, CHT, BDW, HSW and SUE.
Error for BYT, CHT

/home/pxl/xcc/install/tools/RD-2012.5-linux/XtensaTools/bin/xt-ld: sof section `.text' will not fit in region `sof_text_start'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memset':
/home/pxl/work/sof/sof/src/lib/lib.c:56: undefined reference to `__vec_memcpy'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memcpy_s':
/home/pxl/work/sof/sof/src/arch/xtensa/include/arch/string.h:58: undefined reference to `__vec_memcpy'

BDW, HSW

CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memset':
/home/pxl/work/sof/sof/src/lib/lib.c:56: undefined reference to `__vec_memcpy'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memcpy_s':
/home/pxl/work/sof/sof/src/arch/xtensa/include/arch/string.h:58: undefined reference to `__vec_memcpy'
/home/pxl/work/sof/sof/build_bdw_xcc/haswell.x:140: undefined symbol `XCHAL_VECBASE_RESET_PADDR' referenced in expression

SUE

/home/pxl/xcc/install/tools/RG-2017.8-linux/XtensaTools/bin/xt-ld: bootloader section `.text' will not fit in region `sof_text'

@jajanusz

Copy link
Copy Markdown
Contributor

@jajanusz@tlauda Could you help to check the build fail for the BYT, CHT, BDW, HSW and SUE.
Error for BYT, CHT

/home/pxl/xcc/install/tools/RD-2012.5-linux/XtensaTools/bin/xt-ld: sof section `.text' will not fit in region `sof_text_start'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memset':
/home/pxl/work/sof/sof/src/lib/lib.c:56: undefined reference to `__vec_memcpy'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memcpy_s':
/home/pxl/work/sof/sof/src/arch/xtensa/include/arch/string.h:58: undefined reference to `__vec_memcpy'

BDW, HSW

CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memset':
/home/pxl/work/sof/sof/src/lib/lib.c:56: undefined reference to `__vec_memcpy'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memcpy_s':
/home/pxl/work/sof/sof/src/arch/xtensa/include/arch/string.h:58: undefined reference to `__vec_memcpy'
/home/pxl/work/sof/sof/build_bdw_xcc/haswell.x:140: undefined symbol `XCHAL_VECBASE_RESET_PADDR' referenced in expression

SUE

/home/pxl/xcc/install/tools/RG-2017.8-linux/XtensaTools/bin/xt-ld: bootloader section `.text' will not fit in region `sof_text'

Error says pretty much what problem is, .text section is too small to fit generated binary code. You need to tune memory.h in platform/{baytrail,haswell}.

@tlauda

Copy link
Copy Markdown
Contributor

@xiulipan And also __vec_memcpy is probably not supported on HIFI2, so you need to add additional check in string.h in xtensa arch.

@xiulipan

Copy link
Copy Markdown
ContributorAuthor

@jajanusz@tlauda Thanks for hint.
Can we merge this PR first so that we can have unify test env for the fix?

@tlauda

Copy link
Copy Markdown
Contributor

@xiulipan Don't you want to add fixes into this PR first?

@xiulipan

Copy link
Copy Markdown
ContributorAuthor

@tlauda@jajanusz And some fix and pass the test locally.
Please check.

@xiulipanxiulipan changed the title scripts: update xcc build for all platformEnable xcc build for all platformOct 31, 2019
Comment threadsrc/platform/baytrail/include/platform/lib/memory.h Outdated
@xiulipan

Copy link
Copy Markdown
ContributorAuthor

@tlauda@jajanusz@macchian@lbetlej
Update the PR with optimization level change and hifi2 fix for void pointer arithmetic

jajanusz
jajanusz previously requested changes Nov 5, 2019
Comment threadsrc/arch/xtensa/CMakeLists.txt Outdated
@jajanuszjajanusz mentioned this pull request Nov 5, 2019
@plbossart

Copy link
Copy Markdown
Member

@xiulipan the IRAM sizes look wrong to me. we've always used 14000

e.g.

#defineSST_BYT_IRAM_PHY_START	0xff2c0000
#defineSST_BYT_IRAM_PHY_END	0xff2d4000
#defineSST_BYT_DRAM_PHY_START	0xff300000
#defineSST_BYT_DRAM_PHY_END	0xff320000

Comment threadsrc/lib/alloc.c Outdated
Comment threadsrc/arch/xtensa/CMakeLists.txt Outdated
@xiulipan

Copy link
Copy Markdown
ContributorAuthor

@xiulipan the IRAM sizes look wrong to me. we've always used 14000

e.g.

#defineSST_BYT_IRAM_PHY_START	0xff2c0000
#defineSST_BYT_IRAM_PHY_END	0xff2d4000
#defineSST_BYT_DRAM_PHY_START	0xff300000
#defineSST_BYT_DRAM_PHY_END	0xff320000

@plbossart@tlauda already correct me here, so we try to use -Os flag to avoid the issue.

@lgirdwood The -Os is just a test for my build test. I think I got @jajanusz help to have different optimization level with #2054
Will try to tune the default value for different build and compiler.

@xiulipanxiulipan mentioned this pull request Nov 6, 2019
@xiulipanxiulipan changed the title Enable xcc build for all platform[WIP]Enable xcc build for all platformNov 6, 2019
@libinyang

Copy link
Copy Markdown
Contributor

@xiulipan I saw your patches changes some default value in common file. Will it impact on gcc build?

@jajanusz

jajanusz commented Nov 12, 2019

Copy link
Copy Markdown
Contributor

@xiulipan I saw your patches changes some default value in common file. Will it impact on gcc build?

These XTENSA_* variables are not used by GCC, only XCC toolchain is controlled by env variables

@lgirdwood

Copy link
Copy Markdown
Member

@xiulipan any ETA for landing this ?

@xiulipan

Copy link
Copy Markdown
ContributorAuthor

@lrgirdwo Hope I can do that in this week. Still need to figure out how to switch the optimization level by default.

@jajanusz

Copy link
Copy Markdown
Contributor

@lrgirdwo Hope I can do that in this week. Still need to figure out how to switch the optimization level by default.

Just add CONFIG_OPTIMIZE_FOR_SIZE=y in baytrail_defconfig ;)

xcc HIFI2 do not vec_memcpy, we can only use vec_memcpy on HIFI3 supported
platforms.
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Use SOF_MEM_VECBASE_TEXT_BASE to repalce unset variable.
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
xcc build will have bigger TEXT.
Need to keep the total block size unchange as the block need to be
4k align.
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
bay cht and sue xcc build has bigger size, need to use -Os to reduce size.
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Update xcc build config for all existing platforms.
xcc build with byt, cht and sue need special defconfig.
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
@xiulipanxiulipan changed the title [WIP]Enable xcc build for all platformEnable xcc build for all platformNov 14, 2019
@xiulipan

Copy link
Copy Markdown
ContributorAuthor

@lrgirdwo@jajanusz updated to add CONFIG_OPTIMIZE_FOR_SIZE=y in baytrail_xcc_defconfig

All xcc build pass on byt cht bdw hsw apl skl kbl cnl icl jsl with local test.

@lgirdwoodlgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we roll this now int CI so that it builds using XCC and has download links for binaries (using community key) and ldc files.

@tlauda

Copy link
Copy Markdown
Contributor

@xiulipan@lgirdwood Is this ready to be merged?

@lgirdwood

Copy link
Copy Markdown
Member

@tlauda yep, if you approve it. We only have 1 approver atm. me.

@tlauda
tlauda merged commit 7d52bb6 into thesofproject:masterNov 26, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@xiulipan@jajanusz@tlauda@plbossart@libinyang@lgirdwood@paulstelian97