Skip to contentSkip to conversation

aarch64-linux-user compilation error

Qemu-devel Pranith Kumar 3 participants 7 messages Dec 11, 2016 – Dec 13, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

I am getting a strange compilation error lately for aarch64-linux-user. I think it is somehow related to TYPE_PTRVOID handling but my investigation has not led to anything concrete. I think this is a compiler error since the build passes on an other system with gcc-6.

Info: ubuntu 16.04 x86_64 system

$ gcc --version
gcc (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904

Error:
/home/pranith/devops/code/qemu/linux-user/ioctls.h:224:9: error: ‘SNDCTL_DSP_MAPINBUF’ undeclared here (not in a function)
IOCTL(SNDCTL_DSP_MAPINBUF, IOC_R, MK_PTR(MK_STRUCT(STRUCT_buffmem_desc)))

         ^
/home/pranith/devops/code/qemu/linux-user/syscall.c:5453:23: note: in definition of macro ‘IOCTL’
     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
                       ^
/home/pranith/devops/code/qemu/linux-user/ioctls.h:225:9: error: ‘SNDCTL_DSP_MAPOUTBUF’ undeclared here (not in a function)
   IOCTL(SNDCTL_DSP_MAPOUTBUF, IOC_R, MK_PTR(MK_STRUCT(STRUCT_buffmem_desc)))
         ^
/home/pranith/devops/code/qemu/linux-user/syscall.c:5453:23: note: in definition of macro ‘IOCTL’
     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
                       ^
/home/pranith/devops/code/qemu/linux-user/ioctls.h:280:9: error: ‘SOUND_MIXER_ACCESS’ undeclared here (not in a function)
   IOCTL(SOUND_MIXER_ACCESS, 0, TYPE_PTRVOID)
         ^
/home/pranith/devops/code/qemu/linux-user/syscall.c:5453:23: note: in definition of macro ‘IOCTL’
     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
                       ^

/home/pranith/devops/code/qemu/rules.mak:60: recipe for target 'linux-user/syscall.o' failed

Signature · 1 line
Pranith
#1 lore raw
Quoted 7 lines · Pranith Kumar

Hi,

I am getting a strange compilation error lately for aarch64-linux-user. I think it is somehow related to TYPE_PTRVOID handling but my investigation has not led to anything concrete. I think this is a compiler error since the build passes on an other system with gcc-6.

Quoted 5 lines

Info: ubuntu 16.04 x86_64 system

$ gcc --version
gcc (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904

The issue occurs even with a newer gcc.

$ gcc --version
gcc (Ubuntu 6.2.0-3ubuntu11~16.04) 6.2.0 20160901
Signature · 1 line
Pranith
#2 lore raw
In reply to Pranith Kumar
Quoted 9 lines · Pranith Kumar

I am getting a strange compilation error lately for aarch64-linux-user. I think it is somehow related to TYPE_PTRVOID handling but my investigation has not led to anything concrete. I think this is a compiler error since the build passes on an other system with gcc-6.

Error:
/home/pranith/devops/code/qemu/linux-user/ioctls.h:224:9: error: ‘SNDCTL_DSP_MAPINBUF’ undeclared here (not in a function)
IOCTL(SNDCTL_DSP_MAPINBUF, IOC_R, MK_PTR(MK_STRUCT(STRUCT_buffmem_desc)))

         ^

SNDCTL_DSP_MAPINBUF is supposed to be defined by your system headers (/usr/include/linux/soundcard.h or equivalent). Similarly for SNDCTL_DSP_MAPOUTBUF and SOUND_MIXER_ACCESS.

Looking at QEMU's git history we've used these symbols for years. I would check whether your system headers are actually providing these symbols (and that the compiler is really putting the right headers on the include path).

thanks
-- PMM

#3 lore raw
Quoted 10 lines · Peter Maydell
Quoted 5 lines

Error:
/home/pranith/devops/code/qemu/linux-user/ioctls.h:224:9: error: ‘SNDCTL_DSP_MAPINBUF’ undeclared here (not in a function)
IOCTL(SNDCTL_DSP_MAPINBUF, IOC_R, MK_PTR(MK_STRUCT(STRUCT_buffmem_desc)))

         ^

SNDCTL_DSP_MAPINBUF is supposed to be defined by your system headers (/usr/include/linux/soundcard.h or equivalent). Similarly for SNDCTL_DSP_MAPOUTBUF and SOUND_MIXER_ACCESS.

Quoted 5 lines

Looking at QEMU's git history we've used these symbols for years. I would check whether your system headers are actually providing these symbols (and that the compiler is really putting the right headers on the include path).

So soundcard.h header is provided by two packages:

$ apt-file search /usr/include/linux/soundcard.h
linux-libc-dev: /usr/include/linux/soundcard.h
oss4-dev: /usr/include/linux/soundcard.h

I had oss4-dev installed. After removing that and reinstalling linux-libc-dev, it compiles fine. Not sure why this file differs. May be a packaging issue.

Thanks for the help!

Signature · 1 line
Pranith
#4 lore raw
Quoted 19 lines · Pranith Kumar
Quoted 10 lines · Peter Maydell
Quoted 5 lines

Error:
/home/pranith/devops/code/qemu/linux-user/ioctls.h:224:9: error: ‘SNDCTL_DSP_MAPINBUF’ undeclared here (not in a function)
IOCTL(SNDCTL_DSP_MAPINBUF, IOC_R, MK_PTR(MK_STRUCT(STRUCT_buffmem_desc)))

         ^

SNDCTL_DSP_MAPINBUF is supposed to be defined by your system headers (/usr/include/linux/soundcard.h or equivalent). Similarly for SNDCTL_DSP_MAPOUTBUF and SOUND_MIXER_ACCESS.

Quoted 5 lines

Looking at QEMU's git history we've used these symbols for years. I would check whether your system headers are actually providing these symbols (and that the compiler is really putting the right headers on the include path).

So soundcard.h header is provided by two packages:

Quoted 7 lines
$ apt-file search /usr/include/linux/soundcard.h
linux-libc-dev: /usr/include/linux/soundcard.h
oss4-dev: /usr/include/linux/soundcard.h

I had oss4-dev installed. After removing that and reinstalling linux-libc-dev, it compiles fine. Not sure why this file differs. May be a packaging issue.

Sounds like it. How did you ensure you had your QEMU build dependencies installed on your system?

--
Alex Bennée

#5 lore raw

Hi Alex,

Quoted 4 lines · Alex Bennée

Sounds like it. How did you ensure you had your QEMU build dependencies installed on your system?

I did:

$ sudo apt-get build-dep qemu

to get all the build dependencies. I must have recently installed oss4-dev through some other package which overwrote soundcard.h. It was working fine earlier.

Signature · 1 line
Pranith
#6 lore raw
Quoted 8 lines · Pranith Kumar

Hi Alex,

Quoted 4 lines · Alex Bennée

Sounds like it. How did you ensure you had your QEMU build dependencies installed on your system?

Quoted 7 lines

I did:

$ sudo apt-get build-dep qemu

to get all the build dependencies. I must have recently installed oss4-dev through some other package which overwrote soundcard.h. It was working fine earlier.

aptitude why oss4-dev

Might tell you what happened. Anyway glad it's fixed now.

--
Alex Bennée