Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failed on Ubuntu 18.04 #5

Open
marcoszh opened this issue May 31, 2020 · 2 comments
Open

Compilation failed on Ubuntu 18.04 #5

marcoszh opened this issue May 31, 2020 · 2 comments

Comments

@marcoszh
Copy link

Hi I tried to compile the linux driver, but failed on ubuntu 18.04. After switching to Ubuntu 16.04, it compiles fine.

Please dind the make stdout enclosed.

ubuntu@accvm:/driver/linux-sgx-driver$ make
make -C /lib/modules/5.3.0-1020-azure/build SUBDIRS=/home/ubuntu/driver/linux-sgx-driver modules
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-1020-azure'
Makefile:227: ================= WARNING ================
Makefile:228: 'SUBDIRS' will be removed after Linux 5.3
Makefile:229:
Makefile:230: If you are building an individual subdirectory
Makefile:231: in the kernel tree, you can do like this:
Makefile:232: $ make path/to/dir/you/want/to/build/
Makefile:233: (Do not forget the trailing slash)
Makefile:234:
Makefile:235: If you are building an external module,
Makefile:236: Please use 'M=' or 'KBUILD_EXTMOD' instead
Makefile:237: ==========================================
CC [M] /home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.o
/home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.c: In function ‘sgx_test_and_clear_young’:
/home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.c:130:8: error: passing argument 4 of ‘apply_to_page_range’ from incompatible pointer type [-Werror=incompatible-pointer-types]
sgx_test_and_clear_young_cb, vma->vm_mm);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/highmem.h:8:0,
from /home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.c:63:
./include/linux/mm.h:2678:12: note: expected ‘pte_fn_t {aka int (*)(struct *, long unsigned int, void )}’ but argument is of type ‘int ()(pte_t *, struct page *, long unsigned int, void ) {aka int ()(struct *, struct page *, long unsigned int, void *)}’
extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:288: recipe for target '/home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.o' failed
make[2]: *** [/home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.o] Error 1
Makefile:1656: recipe for target 'module/home/ubuntu/driver/linux-sgx-driver' failed
make[1]: *** [module/home/ubuntu/driver/linux-sgx-driver] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.3.0-1020-azure'
Makefile:15: recipe for target 'default' failed
make: *** [default] Error 2
ubuntu@accvm:
/driver/linux-sgx-driver$ make clean
rm -vrf *.o *.ko *.order *.symvers *.mod.c .tmp_versions .o.cmd
removed 'sgx_main.o'
removed '.sgx_main.o.cmd'
ubuntu@accvm:~/driver/linux-sgx-driver$ make
make -C /lib/modules/5.3.0-1020-azure/build SUBDIRS=/home/ubuntu/driver/linux-sgx-driver modules
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-1020-azure'
Makefile:227: ================= WARNING ================
Makefile:228: 'SUBDIRS' will be removed after Linux 5.3
Makefile:229:
Makefile:230: If you are building an individual subdirectory
Makefile:231: in the kernel tree, you can do like this:
Makefile:232: $ make path/to/dir/you/want/to/build/
Makefile:233: (Do not forget the trailing slash)
Makefile:234:
Makefile:235: If you are building an external module,
Makefile:236: Please use 'M=' or 'KBUILD_EXTMOD' instead
Makefile:237: ==========================================
CC [M] /home/ubuntu/driver/linux-sgx-driver/sgx_main.o
CC [M] /home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.o
/home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.c: In function ‘sgx_test_and_clear_young’:
/home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.c:130:8: error: passing argument 4 of ‘apply_to_page_range’ from incompatible pointer type [-Werror=incompatible-pointer-types]
sgx_test_and_clear_young_cb, vma->vm_mm);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/highmem.h:8:0,
from /home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.c:63:
./include/linux/mm.h:2678:12: note: expected ‘pte_fn_t {aka int (
)(struct *, long unsigned int, void )}’ but argument is of type ‘int ()(pte_t *, struct page *, long unsigned int, void ) {aka int ()(struct *, struct page *, long unsigned int, void *)}’
extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:288: recipe for target '/home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.o' failed
make[2]: *** [/home/ubuntu/driver/linux-sgx-driver/sgx_page_cache.o] Error 1
Makefile:1656: recipe for target 'module/home/ubuntu/driver/linux-sgx-driver' failed
make[1]: *** [module/home/ubuntu/driver/linux-sgx-driver] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.3.0-1020-azure'
Makefile:15: recipe for target 'default' failed
make: *** [default] Error 2
ubuntu@accvm:/driver/linux-sgx-driver$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
ubuntu@accvm:
/driver/linux-sgx-driver$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

@jhabarsingh
Copy link

I am getting this error, Please if anyone of you know how to debug then do reply.

make -C tools
make[1]: Entering directory '/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory '/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/tools'
/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/tools/bin2h
cp -f os/linux/Makefile.6 /home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux/Makefile
make -C /lib/modules/5.3.0-61-generic/build SUBDIRS=/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux modules
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-61-generic'
Makefile:227: ================= WARNING ================
Makefile:228: 'SUBDIRS' will be removed after Linux 5.3
Makefile:229:
Makefile:230: If you are building an individual subdirectory
Makefile:231: in the kernel tree, you can do like this:
Makefile:232: $ make path/to/dir/you/want/to/build/
Makefile:233: (Do not forget the trailing slash)
Makefile:234:
Makefile:235: If you are building an external module,
Makefile:236: Please use 'M=' or 'KBUILD_EXTMOD' instead
Makefile:237: ==========================================
CC [M] /home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux/../../sta/sync.o
/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux/../../sta/sync.c: In function ‘PeerBeacon’:
/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux/../../sta/sync.c:2180:12: error: passing argument 8 of ‘StaAddMacTableEntry’ from incompatible pointer type [-Werror=incompatible-pointer-types]
ie_list,
^~~~~~~
In file included from /home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/include/rt_config.h:59:0,
from /home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux/../../sta/sync.c:28:
/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/include/rtmp.h:7892:9: note: expected ‘IE_LISTS * {aka struct _IE_lists *}’ but argument is of type ‘BCN_IE_LIST * {aka struct _bcn_ie_list *}’
BOOLEAN StaAddMacTableEntry(
^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:288: recipe for target '/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux/../../sta/sync.o' failed
make[2]: *** [/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux/../../sta/sync.o] Error 1
Makefile:1656: recipe for target 'module/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux' failed
make[1]: *** [module/home/jhabar/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.3.0-61-generic'
Makefile:394: recipe for target 'LINUX' failed
make: *** [LINUX] Error 2

@lengyijun
Copy link

cd
git clone https://github.com/fortanix/linux-sgx-driver fortanix-linux-sgx-driver 
cd  fortanix-linux-sgx-driver 
git diff HEAD~ > /tmp/a.diff

cd 
git clone https://github.com/intel/linux-sgx-driver
cd linux-sgx-driver
git apply --3way /tmp/a.diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants