[llvm-bugs] [Bug 33768] New: Building alsa-tools-1.1.0 fails linkage due to inlining

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 13 06:07:40 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33768

            Bug ID: 33768
           Summary: Building alsa-tools-1.1.0 fails linkage due to
                    inlining
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: moxian at protonmail.ch
                CC: llvm-bugs at lists.llvm.org

Created attachment 18785
  --> https://bugs.llvm.org/attachment.cgi?id=18785&action=edit
as10k1-minified.c

When trying to compile alsa-tools-1.1.0 (source at
ftp://ftp.alsa-project.org/pub/tools/alsa-tools-1.1.0.tar.bz2), clang fails
with the following log:


make[2]: Entering directory
'/home/moxian/work/alsa-tools/alsa-tools-1.1.0/as10k1'
clang-3.9 -DPACKAGE_NAME=\"as10k1.c\" -DPACKAGE_TARNAME=\"as10k1-c\"
-DPACKAGE_VERSION=\"A0.99\" -DPACKAGE_STRING=\"as10k1.c\ A0.99\"
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1
-DPACKAGE=\"as10k1-c\" -DVERSION=\"A0.99\" -I.    -fno-strict-aliasing -O2
-Wall -pipe -g -MT as10k1.o -MD -MP -MF .deps/as10k1.Tpo -c -o as10k1.o
as10k1.c
mv -f .deps/as10k1.Tpo .deps/as10k1.Po
clang-3.9 -DPACKAGE_NAME=\"as10k1.c\" -DPACKAGE_TARNAME=\"as10k1-c\"
-DPACKAGE_VERSION=\"A0.99\" -DPACKAGE_STRING=\"as10k1.c\ A0.99\"
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1
-DPACKAGE=\"as10k1-c\" -DVERSION=\"A0.99\" -I.    -fno-strict-aliasing -O2
-Wall -pipe -g -MT parse.o -MD -MP -MF .deps/parse.Tpo -c -o parse.o parse.c
mv -f .deps/parse.Tpo .deps/parse.Po
clang-3.9 -DPACKAGE_NAME=\"as10k1.c\" -DPACKAGE_TARNAME=\"as10k1-c\"
-DPACKAGE_VERSION=\"A0.99\" -DPACKAGE_STRING=\"as10k1.c\ A0.99\"
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1
-DPACKAGE=\"as10k1-c\" -DVERSION=\"A0.99\" -I.    -fno-strict-aliasing -O2
-Wall -pipe -g -MT assemble.o -MD -MP -MF .deps/assemble.Tpo -c -o assemble.o
assemble.c
mv -f .deps/assemble.Tpo .deps/assemble.Po
clang-3.9 -DPACKAGE_NAME=\"as10k1.c\" -DPACKAGE_TARNAME=\"as10k1-c\"
-DPACKAGE_VERSION=\"A0.99\" -DPACKAGE_STRING=\"as10k1.c\ A0.99\"
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1
-DPACKAGE=\"as10k1-c\" -DVERSION=\"A0.99\" -I.    -fno-strict-aliasing -O2
-Wall -pipe -g -MT macro.o -MD -MP -MF .deps/macro.Tpo -c -o macro.o macro.c
mv -f .deps/macro.Tpo .deps/macro.Po
clang-3.9 -fno-strict-aliasing -O2 -Wall -pipe -g   -o as10k1 as10k1.o parse.o
assemble.o macro.o  
as10k1.o: In function `header':
/home/moxian/work/alsa-tools/alsa-tools-1.1.0/as10k1/as10k1.c:524: undefined
reference to `output_tram_line'
/home/moxian/work/alsa-tools/alsa-tools-1.1.0/as10k1/as10k1.c:527: undefined
reference to `output_tram_line'
/home/moxian/work/alsa-tools/alsa-tools-1.1.0/as10k1/as10k1.c:539: undefined
reference to `output_tram_line'
/home/moxian/work/alsa-tools/alsa-tools-1.1.0/as10k1/as10k1.c:543: undefined
reference to `output_tram_line'
clang-3.9: error: linker command failed with exit code 1 (use -v to see
invocation)
make[2]: *** [Makefile:320: as10k1] Error 1


The problem seems to be that output_tram_line is declared as inline and is
elided, yet still has references to it.

Minified reproduction case attached (reproducible by simply running `clang
as10k1-minified.c`) . Trying to do *any* modifications to the output_tram_line
function make the code compile suddenly.

Reading http://llvm.org/docs/HowToSubmitABug.html I'm not sure what kind of
additional information is needed (as the compiler does not crash), but am happy
to provide any, if needed.

I can reproduce the bug with both clang-3.9 and with clang-5.0 from (a ~week
old) trunk.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170713/76adabe6/attachment.html>


More information about the llvm-bugs mailing list