This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix location where math-vector-fortran.h is installed.
- From: Martin Liška <mliska at suse dot cz>
- To: Florian Weimer <fweimer at redhat dot com>, Zack Weinberg <zackw at panix dot com>
- Cc: Joseph Myers <joseph at codesourcery dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 1 Mar 2019 10:31:01 +0100
- Subject: Re: [PATCH] Fix location where math-vector-fortran.h is installed.
- References: <863ffa3b-af66-7d82-21a8-e809fd6c1b62@suse.cz> <cc256939-cd6c-9bce-0145-b27f7d3207ea@suse.cz> <alpine.DEB.2.21.1902191752550.25414@digraph.polyomino.org.uk> <CAKCAbMgnLmLiB-i=ivyCN-NfN4rGgsz+Scy7SKwZGjLJ-5TOyw@mail.gmail.com> <08214004-67b7-ce24-07ec-3cd685c65038@suse.cz> <CAKCAbMjO9PL6YHrKOsEyyEat_X+Jek2Cwnm5ZLtf2nkN0LEAFw@mail.gmail.com> <84b2b212-a70a-e18a-5929-d89d6014fb70@suse.cz> <44cd0edb-2ab3-2908-8adb-f2e06859ecfe@suse.cz> <alpine.DEB.2.21.1902261804390.26257@digraph.polyomino.org.uk> <57bb8e48-8805-91ca-9902-9c6fbc3d5360@suse.cz> <87imx62qtr.fsf@oldenburg2.str.redhat.com> <CAKCAbMhaKT5aOzK=+eDjA=aeH_RJSQKQcwE0_Cc6MG0KHfu+FQ@mail.gmail.com> <e1bdc055-e8a8-d3a9-794e-1f722bc82f1e@suse.cz> <CAKCAbMhv6wVpZrLTziv+98FSquofh5pmoLQ=A7M40+57Fd1P1Q@mail.gmail.com> <974399a2-cf1a-1b23-bb9d-b97772278335@suse.cz> <CAKCAbMib2oE-UvBDFkjYdJph=jgh1R_3oCK15rrWfq7Kkk9B0A@mail.gmail.com> <874l8oqbrb.fsf@oldenburg2.str.redhat.com>
On 2/28/19 2:32 PM, Florian Weimer wrote:
> * Zack Weinberg:
>
>> Revised patch looks good to me except:
>>
>>> -! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*-
>>> +! Platform-specific declarations of SIMD math functions for Fortran.
>>
>> Let's keep the -*- f90 -*- annotations, they will also be helpful for
>> future people editing these files. For instance, on my computer, both
>> emacs and vim use the Fortran syntax highlighting rules for these
>> files when the annotation is present, and the C rules when it's
>> absent.
>>
>>> + # Skip Fortran header files
>>> + if 'finclude' in header:
>>> + continue
>>
>> I think this conditional should be
>>
>> if header.startswith('finclude/') or '/finclude/' in header
>>
>> so that it only applies to headers in the directory 'finclude', not
>> any hypothetical future headers that happen to have the string
>> 'finclude' in their base names. (I don't know why that would happen,
>> but if it ever did, I can see someone being really confused why it
>> wasn't getting tested, so some extra defensiveness now seems like a
>> good idea.)
>
> I agree. Maybe also add a period to the end of the comment. 8-)
>
> Thanks,
> Florian
>
Thank you both for help, I've updated the patch.
Martin
>From 74b9d0deddbcb0f6433be937f6b1d7f632e257d6 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 26 Feb 2019 18:17:36 +0100
Subject: [PATCH] Fix location where math-vector-fortran.h is installed.
ChangeLog:
2019-02-26 Martin Liska <mliska@suse.cz>
* math/Makefile: Change location where math-vector-fortran.h is
installed.
* math/finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h.
* sysdeps/x86/fpu/finclude/math-vector-fortran.h: Move
from sysdeps/x86/fpu/bits/math-vector-fortran.h.
* scripts/check-installed-headers.sh: Skip Fortran header files.
* scripts/check-wrapper-headers.py: Likewise.
---
math/Makefile | 2 +-
{bits => math/finclude}/math-vector-fortran.h | 0
scripts/check-installed-headers.sh | 4 ++++
scripts/check-wrapper-headers.py | 4 ++++
sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h | 0
5 files changed, 9 insertions(+), 1 deletion(-)
rename {bits => math/finclude}/math-vector-fortran.h (100%)
rename sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h (100%)
diff --git a/math/Makefile b/math/Makefile
index fc4191089d..cb4eaec6a9 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -26,7 +26,7 @@ headers := math.h bits/mathcalls.h bits/mathinline.h \
fpu_control.h complex.h bits/cmathcalls.h fenv.h \
bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \
bits/math-finite.h bits/math-vector.h \
- bits/math-vector-fortran.h \
+ finclude/math-vector-fortran.h \
bits/libm-simd-decl-stubs.h bits/iscanonical.h \
bits/flt-eval-method.h bits/fp-fast.h bits/fp-logb.h \
bits/long-double.h bits/mathcalls-helper-functions.h \
diff --git a/bits/math-vector-fortran.h b/math/finclude/math-vector-fortran.h
similarity index 100%
rename from bits/math-vector-fortran.h
rename to math/finclude/math-vector-fortran.h
diff --git a/scripts/check-installed-headers.sh b/scripts/check-installed-headers.sh
index 8e7beffd82..1f4496446c 100644
--- a/scripts/check-installed-headers.sh
+++ b/scripts/check-installed-headers.sh
@@ -84,6 +84,10 @@ for header in "$@"; do
(sys/elf.h)
continue;;
+ # Skip Fortran headers.
+ (finclude/*)
+ continue;;
+
# sys/sysctl.h is unsupported for x32.
(sys/sysctl.h)
case "$is_x32" in
diff --git a/scripts/check-wrapper-headers.py b/scripts/check-wrapper-headers.py
index 094faa3ced..dc9fd86063 100644
--- a/scripts/check-wrapper-headers.py
+++ b/scripts/check-wrapper-headers.py
@@ -75,6 +75,10 @@ def check_headers(args):
is_nonsysdep_header = os.access(header, os.R_OK)
if is_nonsysdep_header:
+ # Skip Fortran header files.
+ if '/finclude/' in header:
+ continue
+
include_path = os.path.join(args.root, INCLUDE, header)
if not os.access(include_path, os.R_OK):
print('error: missing wrapper header {} for {}'.format(
diff --git a/sysdeps/x86/fpu/bits/math-vector-fortran.h b/sysdeps/x86/fpu/finclude/math-vector-fortran.h
similarity index 100%
rename from sysdeps/x86/fpu/bits/math-vector-fortran.h
rename to sysdeps/x86/fpu/finclude/math-vector-fortran.h
--
2.20.1