#116 %_fix_broken_configure_for_lto: preserve line continuations
Opened 3 years ago by jjames. Modified 2 months ago
Unknown source master  into  rawhide

file modified
+1 -1
@@ -184,7 +184,7 @@

      diff -u $file.backup $file && mv $file.backup $file \

      %{__sed} --in-place=.backup '1{$!N;$!N};$!N;s/int x = 1;\\nint y = 0;\\nint z;\\nint nan;/volatile int x = 1; volatile int y = 0; volatile int z, nan;/;P;D' $file; \

      diff -u $file.backup $file && mv $file.backup $file \

-     %{__sed} --in-place=.backup 's#^lt_cv_sys_global_symbol_to_cdecl=.*#lt_cv_sys_global_symbol_to_cdecl="sed -n -e '"'"'s/^T .* \\\\(.*\\\\)$/extern int \\\\1();/p'"'"' -e '"'"'s/^$symcode* .* \\\\(.*\\\\)$/extern char \\\\1;/p'"'"'"#' $file; \

+     %{__sed} -r --in-place=.backup '/lt_cv_sys_global_symbol_to_cdecl=/s#(".*"|'"'"'.*'"'"')#"sed -n -e '"'"'s/^T .* \\\\(.*\\\\)$/extern int \\\\1();/p'"'"' -e '"'"'s/^$symcode* .* \\\\(.*\\\\)$/extern char \\\\1;/p'"'"'"#' $file; \

      diff -u $file.backup $file && mv $file.backup $file \

    done

  

The final sed expression of %_fix_broken_configure_for_lto replaces the rest of the line after the assignment operator, thereby discarding any line continuations that may happen to be on that line. This causes https://bugzilla.redhat.com/show_bug.cgi?id=1874144, which I have now seen affect multiple packages. This patch does the same replacements, but preserves line continuations.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

I'm tempted to merge this but I just don't trust my ability to properly untangle the line noise. I think it's safe but would really like another pair of eyes.

Proposed patch seems to work perfectly for me (Rocky Linux 9.3), at least by now (made some test builds with it). A big thank you, @jjames.

I wonder how this PR haven't found a way into released versions for RHEL / Fedora by now, as the issue seem to me quite serious...