]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Build: Fix circular object deps with old GCC
authorOrgad Shaneh <orgads@gmail.com>
Thu, 12 Sep 2024 20:23:46 +0000 (23:23 +0300)
committerRichard Levitte <levitte@openssl.org>
Tue, 17 Sep 2024 05:26:17 +0000 (07:26 +0200)
When both -o and -MT are used, GCC 4.1 prints the object file twice in
the dependency file. e.g.:

foo.o foo.o: foo.c

If the file name is long, then the second occurrence moves to the next
line. e.g.:

ssl/statem/libssl-shlib-statem_dtls.o \
  ssl/statem/libssl-shlib-statem_dtls.o: ../ssl/statem/statem_dtls.c \

add-depends script scans one line at a time, so when the first line is
processed, the object file becomes a dependency itself.

Fix by removing -MT altogether.

This also fixes makedepend for nonstop platform.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25455)

(cherry picked from commit 6288aa440c1ba111eaf52cf79659a25329205022)

Configurations/unix-Makefile.tmpl
NOTES-NONSTOP.md

index 644540397de596792c0df247f95b5aff959e17d5..d2b0797a7edf9d4d65a20c27826dd85c02cd028c 100644 (file)
@@ -1688,7 +1688,7 @@ EOF
       } elsif ($makedep_scheme eq 'gcc' && !grep /\.rc$/, @srcs) {
           $recipe .= <<"EOF";
 $obj: $deps
-       $cmd $incs $defs $cmdflags -MMD -MF $dep.tmp -MT \$\@ -c -o \$\@ $srcs
+       $cmd $incs $defs $cmdflags -MMD -MF $dep.tmp -c -o \$\@ $srcs
        \@touch $dep.tmp
        \@if cmp $dep.tmp $dep > /dev/null 2> /dev/null; then \\
                rm -f $dep.tmp; \\
index ab13de7d3a760af4eccbd7db83a4e1ee440988e1..9441647604c7bbbdd3c187a9fa71d9551febb1b2 100644 (file)
@@ -119,12 +119,9 @@ correctly, you also need the `COMP_ROOT` set, as in:
 
 `COMP_ROOT` needs to be in Windows form.
 
-`Configure` must specify the `no-makedepend` option otherwise errors will
-result when running the build because the c99 cross-compiler does not support
-the `gcc -MT` option. An example of a `Configure` command to be run from the
-OpenSSL directory is:
+An example of a `Configure` command to be run from the OpenSSL directory is:
 
-    ./Configure nonstop-nsx_64 no-makedepend --with-rand-seed=rdcpu
+    ./Configure nonstop-nsx_64 --with-rand-seed=rdcpu
 
 Do not forget to include any OpenSSL cross-compiling prefix and certificate
 options when creating your libraries.