[BUG] Undefined stack protection symbols in MicroBlaze portasm.S

オープン
#1,416 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@furkanyilmazgtb がすでに取り組んでいます。

2026年5月12日 から。

  • #1417 @furkanyilmazgtb による — オープン
  • #1442 @Old-Ding による — オープン

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
18/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
c

調査の方向性

Start with the offset and context-size definitions near the top of portable/portasm.S in the MicroBlaze port, and check how portSLR_OFFSET, portSHR_OFFSET and portCONTEXT_SIZE are used by the save and restore macros. Two open pull requests (#1417 and #1442) already target this, so read them before writing anything new. Done means the assembly builds with XPAR_MICROBLAZE_USE_STACK_PROTECTION across the FPU on/off and __arch64__ combinations, with the offsets consistent in each.

索引モデルが issue の本文から書いたものです。

説明

bug

Describe the bug
In the MicroBlazeV9 FreeRTOS port, enabling XPAR_MICROBLAZE_USE_STACK_PROTECTION requires portSLR_OFFSET and portSHR_OFFSET to be part of the saved task context layout. In portable/portasm.S, these offsets were used in save/restore macros but were not fully integrated with context size/offset definitions, which can lead to undefined-symbol assembler errors or task-context layout mismatch depending on configuration.

This fix integrates stack-protection offsets into context-size definitions for both 32-bit and __arch64__ builds, and aligns portCONTEXT_SIZE / portMINUS_CONTEXT_SIZE with optional FPU + stack-protection fields.

Target

  • Development board: [MicroBlaze-based custom board]
  • Instruction Set Architecture: [MicroBlaze 32-bit (primary), MicroBlaze 64-bit path also updated]
  • IDE and version: [Vitis / XSCT based flow - 2023.2 Classics]
  • Toolchain and version: [mb-gcc ]

Host

  • Host OS: [Windows 11 Pro 25H2]

To Reproduce

  • Use FreeRTOS v11.3.0 MicroBlaze port with XPAR_MICROBLAZE_USE_STACK_PROTECTION enabled.
  • Build portable/portasm.S path with different combinations of:
    • XPAR_MICROBLAZE_USE_FPU = 0/1
    • __arch64__ defined/undefined

Expected behavior
When stack protection is enabled, SLR/SHR registers must have valid context offsets and context frame size must include these fields consistently for all relevant config combinations (32-bit/64-bit, FPU on/off). Save and restore paths should be layout-compatible and stable.

Screenshots

Image Image

Additional context
Patch summary applied in portable/portasm.S:

  • Added conditional stack-protection offsets and adjusted context size in the same definition block:
    • 32-bit + FPU: portFSR_OFFSET=132, portSLR_OFFSET=136, portSHR_OFFSET=140, portCONTEXT_SIZE=144
    • 32-bit no FPU: portSLR_OFFSET=132, portSHR_OFFSET=136, portCONTEXT_SIZE=140
    • 64-bit + FPU: portFSR_OFFSET=264, portSLR_OFFSET=272, portSHR_OFFSET=280, portCONTEXT_SIZE=288
    • 64-bit no FPU: portSLR_OFFSET=264, portSHR_OFFSET=272, portCONTEXT_SIZE=280
  • Removed duplicate portFSR_OFFSET define in offset section to avoid macro redefinition/confusion.

Link to issue post: https://forums.freertos.org/t/microblaze-compilation-error-when-upgrading-to-freertos-v11-3-0/24994

主要言語
C
スター
4.6k
フォーク
1.6k
平均マージ
2日 22時間
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FreeRTOS/FreeRTOS-Kernel のほかの issue

FreeRTOS/FreeRTOS-Kernel の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。