Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Feb 2019 18:30:01 +0000
From:      bugzilla-noreply@freebsd.org
To:        threads@FreeBSD.org
Subject:   [Bug 235583] clang error builtin-requires-header on pthread_create on powerpc64
Message-ID:  <bug-235583-13406@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235583

            Bug ID: 235583
           Summary: clang error builtin-requires-header on pthread_create
                    on powerpc64
           Product: Base System
           Version: CURRENT
          Hardware: powerpc
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: threads
          Assignee: threads@FreeBSD.org
          Reporter: alfredo.junior@eldorado.org.br

Created attachment 201820
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D201820&action=
=3Dedit
Disables -Werror,-Wbuiltin-requires-header on powerpc64

I'm trying to cross compile "base" to powerpc64 using both ports/llm-devel
(SNAPDATE=3D20190122) and llvm from git (revision
f324f6dcfba71ede8dd213096ec3b2f1b57ded86) and build breaks with the followi=
ng
error:

/usr/local/bin/clang -fuse-ld=3D/usr/local/bin/ld.lld -target
powerpc64-unknown-freebsd13.0-elfv2 -mabi=3Delfv2
--sysroot=3D/usr/obj/usr/src/powerpc.powerpc64/tmp -B/dev/null  -O2 -pipe=
=20=20
-DNO__SCCSID -DNO__RCSID -I/usr/src/lib/libc/include -I/usr/src/include
-I/usr/src/lib/libc/powerpc64 -DNLS  -D__DBINTERFACE_PRIVATE
-I/usr/src/contrib/gdtoa -I/usr/src/contrib/libc-vis -DINET6
-I/usr/obj/usr/src/powerpc.powerpc64/lib/libc -I/usr/src/lib/libc/resolv
-D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libmd
-I/usr/src/contrib/jemalloc/include -I/usr/src/contrib/tzcode/stdtime
-I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTM=
AP
-DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING -DSYMBOL_VERSIONING=
 -g
-MD  -MF.depend.__pthread_mutex_init_calloc_cb_stub.o
-MT__pthread_mutex_init_calloc_cb_stub.o -std=3Dgnu99 -fstack-protector-str=
ong
-Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized
-Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int
-Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value
-Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion
-Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch
-Wno-switch-enum -Wno-knr-promoted-parameter  -Qunused-arguments=20
-I/usr/src/lib/libutil -I/usr/src/lib/msun/powerpc -I/usr/src/lib/msun/src =
-c
/usr/src/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c -o
__pthread_mutex_init_calloc_cb_stub.o
In file included from
/usr/src/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c:36:
/usr/src/include/pthread.h:212:6: error: declaration of built-in function
'pthread_create' requires inclusion of the header <pthread.h>
      [-Werror,-Wbuiltin-requires-header]
int             pthread_create(pthread_t * __restrict,
                ^
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/src/lib/libc
#=20

It appears that clang is getting confused about having to include Clang's
built-in "pthread.h"  while it's trying to compile FreeBSD "pthread.h" itse=
lf.
I found similar issue here: https://lkml.org/lkml/2019/1/11/718

The error repeats mentioning "pthread_create" on many other places. As
workaround I created the patch attached.

Please let me know your thoughts.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-235583-13406>