Building modules gives error: "invalid output constraint '=@cce' in asm"

Rajesh Kumar rajfbsd at gmail.com
Wed Jun 17 01:53:58 UTC 2020


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 at 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.
>


More information about the freebsd-current mailing list