aarch64-linux-user compilation error
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
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_PTRVOIDhandling 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_64system$ 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
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_PTRVOIDhandling 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
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_MAPINBUFis supposed to be defined by your system headers (/usr/include/linux/soundcard.hor equivalent). Similarly forSNDCTL_DSP_MAPOUTBUFandSOUND_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
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_MAPINBUFis supposed to be defined by your system headers (/usr/include/linux/soundcard.hor equivalent). Similarly forSNDCTL_DSP_MAPOUTBUFandSOUND_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.hheader 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.hI 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
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
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 qemuto 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