HewlettPackard / quartz

Quartz: A DRAM-based performance emulator for NVM
https://github.com/HewlettPackard/quartz
Other
158 stars 66 forks source link

Errors regarding copy_from_user and libelf-dev are emitted during build #29

Open hadibrais opened 5 years ago

hadibrais commented 5 years ago

When I compile Quartz on Ubuntu 16.04 with kernel 4.15.0.29, I get three errors:

Makefile:976: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"

/home/hadi/code/quartz/build/src/dev/pmc.c: In function ‘pmc_ioctl_setcounter’: /home/hadi/code/quartz/build/src/dev/pmc.c:171:9: error: implicit declaration of function ‘copy_from_user’ [-Werror=implicit-function-declaration] if (copy_from_user(&q, (ioctl_query_setcounter_t*) arg, sizeof(ioctlquery

/home/hadi/code/quartz/build/src/dev/pmc.c: In function ‘pmc_ioctl_getpci’: /home/hadi/code/quartz/build/src/dev/pmc.c:224:17: error: implicit declaration of function ‘copy_to_user’ [-Werror=implicit-function-declaration] if (copy_to_user((ioctl_query_setgetpci_t*) arg, &q, sizeof(ioctl_q

I resolved the first error by installing libelf-dev. Note that this library is not included in the script scripts/install.sh. I resolved the other two errors by modifying pmc.c so that it includes linux/uaccess.h instead of asm/uaccess.h.

After making these changes, the build completes successfully.