Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1200208 > unrolled thread
| Started by | Jes.Sorensen@redhat.com |
|---|---|
| First post | 2015-08-04 20:20 +0200 |
| Last post | 2015-08-04 22:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[RHEL7.2 PATCH] lib/mpi: Teach the code inline 101 Jes.Sorensen@redhat.com - 2015-08-04 20:20 +0200
Re: [RHEL7.2 PATCH] lib/mpi: Teach the code inline 101 Linus Torvalds <torvalds@linux-foundation.org> - 2015-08-04 22:00 +0200
| From | Jes.Sorensen@redhat.com |
|---|---|
| Date | 2015-08-04 20:20 +0200 |
| Subject | [RHEL7.2 PATCH] lib/mpi: Teach the code inline 101 |
| Message-ID | <pTOYG-1uV-19@gated-at.bofh.it> |
From: Jes Sorensen <Jes.Sorensen@redhat.com> The broken extern inline usage resulted in gcc5 duplicating the functions causing link errors due to duplicate symbols. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> --- lib/mpi/mpi-inline.h | 2 +- lib/mpi/mpi-internal.h | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/mpi/mpi-inline.h b/lib/mpi/mpi-inline.h index e2b3985..c245ea3 100644 --- a/lib/mpi/mpi-inline.h +++ b/lib/mpi/mpi-inline.h @@ -30,7 +30,7 @@ #define G10_MPI_INLINE_H #ifndef G10_MPI_INLINE_DECL -#define G10_MPI_INLINE_DECL extern inline +#define G10_MPI_INLINE_DECL static inline #endif G10_MPI_INLINE_DECL mpi_limb_t diff --git a/lib/mpi/mpi-internal.h b/lib/mpi/mpi-internal.h index 60cf765..8eeb6b5 100644 --- a/lib/mpi/mpi-internal.h +++ b/lib/mpi/mpi-internal.h @@ -168,20 +168,22 @@ void mpi_rshift_limbs(MPI a, unsigned int count); int mpi_lshift_limbs(MPI a, unsigned int count); /*-- mpihelp-add.c --*/ -mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, - mpi_size_t s1_size, mpi_limb_t s2_limb); +static inline mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, + mpi_size_t s1_size, mpi_limb_t s2_limb); mpi_limb_t mpihelp_add_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_ptr_t s2_ptr, mpi_size_t size); -mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, - mpi_ptr_t s2_ptr, mpi_size_t s2_size); +static inline mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, + mpi_size_t s1_size, mpi_ptr_t s2_ptr, + mpi_size_t s2_size); /*-- mpihelp-sub.c --*/ -mpi_limb_t mpihelp_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, - mpi_size_t s1_size, mpi_limb_t s2_limb); +static inline mpi_limb_t mpihelp_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, + mpi_size_t s1_size, mpi_limb_t s2_limb); mpi_limb_t mpihelp_sub_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_ptr_t s2_ptr, mpi_size_t size); -mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, - mpi_ptr_t s2_ptr, mpi_size_t s2_size); +static inline mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, + mpi_size_t s1_size, mpi_ptr_t s2_ptr, + mpi_size_t s2_size); /*-- mpihelp-cmp.c --*/ int mpihelp_cmp(mpi_ptr_t op1_ptr, mpi_ptr_t op2_ptr, mpi_size_t size); -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Date | 2015-08-04 22:00 +0200 |
| Message-ID | <pTQxt-3Do-37@gated-at.bofh.it> |
| In reply to | #1200208 |
On Tue, Aug 4, 2015 at 11:18 AM, <Jes.Sorensen@redhat.com> wrote:
>
> The broken extern inline usage resulted in gcc5 duplicating the
> functions causing link errors due to duplicate symbols.
Why isn't gcc fixed instead? The whole "extern inline" thing was
documented to work the way it did, this gcc breakage is annoying, and
I refuse tp apply patches that imply that it is a bug in the kernel
when it's the compiler that messes up.
So it's not "broken extern inline usage". It's a broken compiler
changing things. Again.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web