aboutsummaryrefslogtreecommitdiff
path: root/release/arm64
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2017-09-11 12:15:49 +0000
committerAndriy Gapon <avg@FreeBSD.org>2017-09-11 12:15:49 +0000
commit970165f1903ea9757b1434ca826ba86a1fe98039 (patch)
tree4afabf0799b4a389733d7d49d2d26d242b10284f /release/arm64
parent25625d874697657f9fb9d291d843437f92213811 (diff)
parent03ad5aa4c1f93b5b86c67c9db3cb7754da597a10 (diff)
downloadsrc-970165f1903ea9757b1434ca826ba86a1fe98039.tar.gz
src-970165f1903ea9757b1434ca826ba86a1fe98039.zip
MFV r323111: 8569 problem with inline functions in abd.h
illumos/illumos-gate@37e84ab74e939caf52150fc3352081786ecc0c29 https://github.com/illumos/illumos-gate/commit/37e84ab74e939caf52150fc3352081786ecc0c29 https://www.illumos.org/issues/8569 C [C99] has peculiar rules for inline functions that are different from the C++ rules. Unlike C++ where inline is "fire and forget", in C a programmer must pay attention to the function's storage class / visibility. The main problem is with the case where a compiler decides to not inline a call to the function declared as inline. Some relevant links: - http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15831.html - http://www.drdobbs.com/the-new-c-inline-functions/184401540 The summary is that either the inline functions should be declared 'static inline' or one of the compilation units (.c files) must provide a callable externally visible function definition. In the former case, the compiler would automatically create a local non-inlined function instance in every compilation unit where it's needed. In the latter case the single external definition is used to satisfy any non-inlined calls in all compilation units. As things stand right now, we can get an undefined reference error under certain combinations of compilers and compiler options. For example, this is what I get on FreeBSD when compiling with clang 4.0.0 and -O1: In function `abd_free': /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c:385: undefined reference to `abd_is_linear' Reviewed by: Matt Ahrens <mahrens@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Andriy Gapon <avg@FreeBSD.org> MFC after: 1 week
Notes
Notes: svn path=/head/; revision=323435
Diffstat (limited to 'release/arm64')
0 files changed, 0 insertions, 0 deletions