Date: Wed, 17 Jun 2020 07:23:44 +0530 From: Rajesh Kumar <rajfbsd@gmail.com> To: freebsd-current@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: Building modules gives error: "invalid output constraint '=@cce' in asm" Message-ID: <CAAO%2BANOXw0YquW5QqC%2BbMWzHoCWqNGE-U79RG1bQ%2B3VbjdaARQ@mail.gmail.com> In-Reply-To: <CAAO%2BANN25UODDvdLaqtHt%2BPwkaV-oQzd8tko34C-j3FtUory6g@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
Hi,
Has anyone faced a similar issue?
I had a 12.0-RELEASE kernel earlier. I cloned the master branch and built
world, built kernel and installed kernel with a different kernel name
(INSTKERNNAME) and rebooted the machine and see it booting to 13.0-CURRENT
as expected. Then, I am trying to compile the driver modules and hit the
compilation error. I haven't done "install world" as I don't want the base
12.0 to be disturbed.
When I compared the /usr/include/machine/atomic.h and the atomic.h from the
OBJ directory, I see the below highlighted change. Looks like, building
module is trying to use the headers in OBJ directory as expected, but
hitting the compilation issue.
*12.0 base installation atomic.h*
static __inline int \
atomic_fcmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE *expect, u_##TYPE
src) \
{ \
u_char res; \
\
__asm __volatile( \
" " MPLOCKED " " \
" cmpxchg %3,%1 ; " \
" sete %0 ; " \
"# atomic_fcmpset_" #TYPE " " \
*: "=q" (res), /* 0 */ \ *
"+m" (*dst), /* 1 */ \
"+a" (*expect) /* 2 */ \
: "r" (src) /* 3 */ \
: "memory", "cc"); \
return (res); \
}
*13.0- CURRENT atomic.h in OBJ dir*
static __inline int \
atomic_fcmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE *expect, u_##TYPE
src) \
{ \
u_char res; \
\
__asm __volatile( \
" " MPLOCKED " " \
"# atomic_fcmpset_" #TYPE " " \
*: "=@cce" (res), /* 0 */ \*
"+m" (*dst), /* 1 */ \
"+a" (*expect) /* 2 */ \
: "r" (src) /* 3 */ \
: "memory", "cc"); \
return (res); \
}
Any clue would be really helpful?
Thanks,
Rajesh
On Tue, Jun 16, 2020 at 12:29 PM Rajesh Kumar <rajfbsd@gmail.com> wrote:
> Hi,
>
> I am trying to build my module with freebsd current branch. But I am
> facing compilation issue with header files as below. I have built and
> installed the freebsd current branch and booted to that kernel before
> building my module. So, not sure what is going wrong.
>
>
>
>
>
>
> *In file included from
> /root//freebsd_current/sys/sys/systm.h:44:./machine/atomic.h:230:1: error:
> invalid output constraint '=@cce' in
> asmATOMIC_CMPSET(char);^./machine/atomic.h:205:4: note: expanded from macro
> 'ATOMIC_CMPSET' : "=@cce" (res), /* 0 */ \*
>
> Am I missing something?
>
> Thanks,
> Rajesh.
>
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAO%2BANOXw0YquW5QqC%2BbMWzHoCWqNGE-U79RG1bQ%2B3VbjdaARQ>
