File hobbits.changes of Package failed_hobbits
Auto-repair result for failed_hobbits
Root cause:
- Build failed during %build due to GCC "narrowing conversion" errors in src/hobbits-core/bitarray.cpp. The source contains brace-initialized arrays with negative integer literals (e.g., -128, -65, -33, ...). With -std=gnu++11 and the distribution's hardening flags, these produce -Wnarrowing diagnostics which were treated as errors, causing the build to abort.
Exact modifications made (minimal):
1) File: temp_workspace/failed_hobbits/hobbits.spec
- Replaced entire spec file content to adjust the %build step.
- Change: The %build section now passes explicit C and CXX flags to CMake that include all standard hardening flags and append -Wno-narrowing to suppress the narrowing conversion diagnostics.
- Rationale: This is a packaging-level fix that avoids modifying upstream source files and preserves intended runtime behavior.
Modified lines (conceptual):
- Original %build:
%build
%cmake -DCMAKE_SKIP_RPATH:BOOL=OFF
%make_build
- New %build (implemented):
%build
# Add -Wno-narrowing to suppress narrowing conversion errors for brace initializers
# while preserving the distro hardening flags. We explicitly set both C and CXX
# flags to the commonly injected hardening flags and append -Wno-narrowing so the
# compiler accepts signed negative literals in braced initializers used by the
# upstream source (avoids changing source files).
%cmake -DCMAKE_SKIP_RPATH:BOOL=OFF \
-DCMAKE_C_FLAGS:STRING="-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -Wno-narrowing" \
-DCMAKE_CXX_FLAGS:STRING="-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -fno-sized-deallocation -Wno-narrowing"
%make_build
Files touched:
- temp_workspace/failed_hobbits/hobbits.spec (replaced content)
- temp_workspace/failed_hobbits/hobbits.changes (this file, report written here)
Why this is minimal:
- Only packaging directives were changed. No source files altered. The change addresses the compiler's diagnostics without altering program logic.
Verification steps (recommended):
- Re-run the OBS build for project home:lalala123:RISCV repository standard arch riscv64 to confirm compile proceeds past the previous error.
Notes and caveats:
- This suppresses the narrowing warning; if the distribution applies additional global flags that conflict, further adjustments might be required.
- Upstream source may still be updated to avoid narrowing; when that happens the suppression can be removed.
Workspace locations:
- Modified spec: temp_workspace/failed_hobbits/hobbits.spec
- Upstream tarball extracted: temp_workspace/failed_hobbits/extracted/hobbits-0.54.1
- Report (this file): temp_workspace/failed_hobbits/hobbits.changes
End of auto-repair.