Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938689 - sys-block/mbuffer-20240707 - [ncurses-6.5] [llvm] idev.c: error: expected identifier or '('
Summary: sys-block/mbuffer-20240707 - [ncurses-6.5] [llvm] idev.c: error: expected ide...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-08-29 16:35 UTC by Toralf Förster
Modified: 2025-01-18 17:35 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,18.94 KB, text/plain)
2024-08-29 16:35 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,202.95 KB, text/plain)
2024-08-29 16:35 UTC, Toralf Förster
Details
environment (environment,88.91 KB, text/plain)
2024-08-29 16:35 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.21 KB, application/x-xz)
2024-08-29 16:35 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,51.81 KB, application/x-xz)
2024-08-29 16:35 UTC, Toralf Förster
Details
logs.tar.xz (logs.tar.xz,5.42 KB, application/x-xz)
2024-08-29 16:35 UTC, Toralf Förster
Details
qlist-info.txt.xz (qlist-info.txt.xz,52.50 KB, application/x-xz)
2024-08-29 16:35 UTC, Toralf Förster
Details
sys-block:mbuffer-20240707:20240829-115021.log (sys-block:mbuffer-20240707:20240829-115021.log,11.92 KB, text/plain)
2024-08-29 16:35 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,30.29 KB, application/x-xz)
2024-08-29 16:35 UTC, Toralf Förster
Details
var.tmp.clang.tar.xz (var.tmp.clang.tar.xz,1.02 KB, application/x-xz)
2024-08-29 16:35 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2024-08-29 16:35:29 UTC
too long lines were shrinked:

bash mkversion.sh
creating version.h
creating man-page
clang -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int -Wno-unused-result -DHAVE_CONFIG_H -DPREFIX=\"/usr\" -I. -I. -c globals.c -o build/globals.o
clang -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int -Wno-unused-result -DHAVE_CONFIG_H -DPREFIX=\"/usr\" -I. -I. -shared -g -fPIC idev.c -o idev.so -lcrypto -lmd -lm -lpthread 
clang -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int -Wno-unused-result -DHAVE_CONFIG_H -DPREFIX=\"/usr\" -I. -I. -shared -fPIC tapetest.c -o tapetest.so -lcrypto -lmd -lm -lpthread 
idev.c:55:15: error: clang  -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int -Wno-unused-result -DHAVE_CONFIG_H -DPREFIX=\"/usr\" -I. -I. -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__
expected identifier or '('
   55 | int LIBC_OPEN(const char *path, int oflag, ...)

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 23.0_llvm-20240825-084454

  UNMASKED:
    Requested by sam
  /etc/portage/package.unmask/50unstable:>=sys-libs/ncurses-6.5

  The attached etc.portage.tar.xz has all details.
  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-13 *
clang/llvm (if any):
clang version 18.1.8+libcxx
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/18/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
/usr/lib/llvm/18
18.1.8+libcxx
Python 3.12.5
Available Rust versions:
  [1]   rust-bin-1.80.1
  [2]   rust-1.80.1 *
The following VMs are available for generation-2:
1)	Eclipse Temurin JDK 11.0.24_p8 [openjdk-bin-11]
2)	Eclipse Temurin JDK 17.0.12_p7 [openjdk-bin-17]
*)	Eclipse Temurin JDK 21.0.4_p7 [openjdk-bin-21]
4)	Eclipse Temurin JDK 8.422_p05 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8 
  [2]   openjdk-bin-11 
  [3]   openjdk-bin-17 
  [4]   openjdk-bin-21  system-vm

The Glorious Glasgow Haskell Compilation System, version 9.2.8
php cli (if any):
go version go1.23.0 linux/amd64

  HEAD of ::gentoo
commit a72ce254e94b4fcd7518f4371b07c1cdb8d931eb
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Thu Aug 29 11:04:19 2024 +0000

    2024-08-29 11:04:18 UTC

emerge -qpvO =sys-block/mbuffer-20240707
[ebuild  N    ] sys-block/mbuffer-20240707  USE="ssl -debug -test"
Comment 1 Toralf Förster gentoo-dev 2024-08-29 16:35:30 UTC
Created attachment 901556 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2024-08-29 16:35:31 UTC
Created attachment 901557 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2024-08-29 16:35:33 UTC
Created attachment 901558 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2024-08-29 16:35:33 UTC
Created attachment 901559 [details]
etc.clang.tar.xz
Comment 5 Toralf Förster gentoo-dev 2024-08-29 16:35:34 UTC
Created attachment 901560 [details]
etc.portage.tar.xz
Comment 6 Toralf Förster gentoo-dev 2024-08-29 16:35:35 UTC
Created attachment 901561 [details]
logs.tar.xz
Comment 7 Toralf Förster gentoo-dev 2024-08-29 16:35:36 UTC
Created attachment 901562 [details]
qlist-info.txt.xz
Comment 8 Toralf Förster gentoo-dev 2024-08-29 16:35:37 UTC
Created attachment 901563 [details]
sys-block:mbuffer-20240707:20240829-115021.log
Comment 9 Toralf Förster gentoo-dev 2024-08-29 16:35:38 UTC
Created attachment 901564 [details]
temp.tar.xz
Comment 10 Toralf Förster gentoo-dev 2024-08-29 16:35:39 UTC
Created attachment 901565 [details]
var.tmp.clang.tar.xz
Comment 11 James McGeehan IV 2024-09-01 04:46:56 UTC
I'm reproducing this. Also on an llvm-glibc profile.  Working fine on llvm-musl.
Comment 12 Zhixu Liu 2025-01-15 09:42:58 UTC
in configure.ac, AC_MSG_CHECKING([linking open() and write() to detect libc names])

# clang -g -O2 -lcrypto -lmd -lm -lpthread a.c
# objdump -T a.out

a.out:     file format elf64-x86-64

DYNAMIC SYMBOL TABLE:
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.2.5) write
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.7)  __open_2
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.34) __libc_start_main
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.4)  __stack_chk_fail
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.33) fstat
0000000000000000  w   D  *UND*  0000000000000000  Base        _ITM_deregisterTMCloneTable
0000000000000000  w   D  *UND*  0000000000000000  Base        __gmon_start__
0000000000000000  w   D  *UND*  0000000000000000  Base        _ITM_registerTMCloneTable
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.4)  __read_chk
0000000000000000  w   DF *UND*  0000000000000000 (GLIBC_2.2.5) __cxa_finalize

# gcc -g -O2 -lcrypto -lmd -lm -lpthread a.c
# objdump -T a.out

a.out:     file format elf64-x86-64

DYNAMIC SYMBOL TABLE:
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.2.5) write
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.2.5) open
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.34) __libc_start_main
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.4)  __stack_chk_fail
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.2.5) read
0000000000000000      DF *UND*  0000000000000000 (GLIBC_2.33) fstat
0000000000000000  w   D  *UND*  0000000000000000  Base        _ITM_deregisterTMCloneTable
0000000000000000  w   D  *UND*  0000000000000000  Base        __gmon_start__
0000000000000000  w   D  *UND*  0000000000000000  Base        _ITM_registerTMCloneTable
0000000000000000  w   DF *UND*  0000000000000000 (GLIBC_2.2.5) __cxa_finalize

for clang with -O2, read is optimized away & open is changed to __open_2, so LIBC_OPEN and LIBC_READ become null

don't know howto pass -O0 to AC_LINK_IFELSE

don't know the reason to test the name of open/read either.
Comment 13 Larry the Git Cow gentoo-dev 2025-01-18 17:35:14 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69fee45923a0a9b2734f3bb150a1f576499904b0

commit 69fee45923a0a9b2734f3bb150a1f576499904b0
Author:     Z. Liu <zhixu.liu@gmail.com>
AuthorDate: 2025-01-15 10:15:37 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-01-18 17:34:27 +0000

    sys-block/mbuffer: fix build failure w/ clang
    
    use "-O0" to compile the feature test code
    
    Closes: https://bugs.gentoo.org/938689
    Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/40141
    Signed-off-by: Sam James <sam@gentoo.org>

 .../mbuffer-20240107-O0-for-libc-name-find.patch   | 38 ++++++++++++++++++++++
 sys-block/mbuffer/mbuffer-20240107.ebuild          |  1 +
 sys-block/mbuffer/mbuffer-20240707.ebuild          |  1 +
 sys-block/mbuffer/mbuffer-20241007.ebuild          |  1 +
 4 files changed, 41 insertions(+)