linux-4.19.134 버전 컴파일 loongson3 버전 오류 해결

10647 단어
1. 컴파일러 환경:
Dell T30  
ubuntu 20.04  
 

2. 컴파일 오류(1)make[3]: *** [scripts/Makefile.build:309:net/ipv4/netfilter/ipt_ECN.o] 오류1
root@T30:/home/george/tx/version# /bin/bash mk.sh build uosdesktop 2>&1 >/dev/null
In file included from ./include/uapi/linux/netfilter_ipv4/ipt_ECN.h:14:0,
                 from net/ipv4/netfilter/ipt_ECN.c:20:
./include/uapi/linux/netfilter/xt_DSCP.h:14:10: fatal error: linux/netfilter/xt_dscp.h: No such file or directory
 #include 
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.build:309:net/ipv4/netfilter/ipt_ECN.o]   1
make[2]: *** [scripts/Makefile.build:544:net/ipv4/netfilter]   2
make[2]: ***  ....
make[1]: *** [scripts/Makefile.build:544:net/ipv4]   2
make: *** [Makefile:1052:net]   2
make: ***  ....
dpkg-buildpackage:  :  
dpkg-architecture:  : specified GNU system type mips64el-linux-gnuabi64 does not match CC system type mips-linux-gnu, try setting a correct CC environment variable
 dpkg-source --before-build .
 debian/rules build
In file included from ./include/uapi/linux/netfilter_ipv4/ipt_ECN.h:14:0,
                 from net/ipv4/netfilter/ipt_ECN.c:20:
./include/uapi/linux/netfilter/xt_DSCP.h:14:10: fatal error: linux/netfilter/xt_dscp.h: No such file or directory
 #include 
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[6]: *** [scripts/Makefile.build:309:net/ipv4/netfilter/ipt_ECN.o]   1
make[5]: *** [scripts/Makefile.build:544:net/ipv4/netfilter]   2
make[5]: ***  ....
make[4]: *** [scripts/Makefile.build:544:net/ipv4]   2
make[3]: *** [Makefile:1052:net]   2
make[3]: ***  ....
make[2]: *** [debian/rules:4:build]   2
dpkg-buildpackage:  : debian/rules build subprocess returned exit status 2
make[1]: *** [scripts/package/Makefile:80:bindeb-pkg]   2
make: *** [Makefile:1365:bindeb-pkg]   2

해결 방법:
sudo cp linux-4.19.134/include/uapi/linux/netfilter/xt_dscp.h loongson_kernel/include/uapi/linux/netfilter/xt_dscp.h

sudo cp linux-4.19.134/net/netfilter/xt_dscp.c loongson_kernel/net/netfilter/xt_dscp.c

(2)make[5]: ***"net/netfilter/xt_hl.c"를 만들 수 있는 규칙이 없습니다. "net/netfilter/xt_hl.o"가 필요합니다.멈추다
/bin/bash mk.sh build uosdesktop 2>&1 >/dev/null
make[2]: ***  “net/netfilter/xt_hl.c”, “net/netfilter/xt_hl.o”  。  。
make[1]: *** [scripts/Makefile.build:544:net/netfilter]   2
make[1]: ***  ....
make: *** [Makefile:1052:net]   2
dpkg-buildpackage:  :  
dpkg-architecture:  : specified GNU system type mips64el-linux-gnuabi64 does not match CC system type mips-linux-gnu, try setting a correct CC environment variable
 dpkg-source --before-build .
 debian/rules build
make[5]: ***  “net/netfilter/xt_hl.c”, “net/netfilter/xt_hl.o”  。  。
make[4]: *** [scripts/Makefile.build:544:net/netfilter]   2
make[4]: ***  ....
make[3]: *** [Makefile:1052:net]   2
make[2]: *** [debian/rules:4:build]   2
dpkg-buildpackage:  : debian/rules build subprocess returned exit status 2
make[1]: *** [scripts/package/Makefile:80:bindeb-pkg]   2
make: *** [Makefile:1365:bindeb-pkg]   2


해결 방법:
sudo cp linux-4.19.134/net/netfilter/xt_hl.c loongson_kernel/net/netfilter/xt_hl.c

(3)make[5]: ***"net/netfilter/xt_rateest.c"를 만들 수 있는 규칙이 없습니다. "net/netfilter/xt_rateest.o"가 필요합니다.멈추다
sudo  /bin/bash mk.sh build uosdesktop 2>&1 >/dev/null
[sudo] george  : 
make[2]: ***  “net/netfilter/xt_rateest.c”, “net/netfilter/xt_rateest.o”  。  。
make[1]: *** [scripts/Makefile.build:544:net/netfilter]   2
make[1]: ***  ....
make: *** [Makefile:1052:net]   2
make: ***  ....
dpkg-buildpackage:  :  
dpkg-architecture:  : specified GNU system type mips64el-linux-gnuabi64 does not match CC system type mips-linux-gnu, try setting a correct CC environment variable
 dpkg-source --before-build .
 debian/rules build
make[5]: ***  “net/netfilter/xt_rateest.c”, “net/netfilter/xt_rateest.o”  。  。
make[4]: *** [scripts/Makefile.build:544:net/netfilter]   2
make[3]: *** [Makefile:1052:net]   2
make[3]: ***  ....
make[2]: *** [debian/rules:4:build]   2
dpkg-buildpackage:  : debian/rules build subprocess returned exit status 2
make[1]: *** [scripts/package/Makefile:80:bindeb-pkg]   2
make: *** [Makefile:1365:bindeb-pkg]   2


해결 방법:
sudo cp linux-4.19.134/net/netfilter/xt_rateest.c loongson_kernel/net/netfilter/xt_rateest.c

(4)make[5]: ***"net/netfilter/xt_tcpmss.c"를 만들 수 있는 규칙이 없습니다. "net/netfilter/xt_tcpmss.o"가 필요합니다.멈추다
sudo  /bin/bash mk.sh build uosdesktop 2>&1 >/dev/null
make[2]: ***  “net/netfilter/xt_tcpmss.c”, “net/netfilter/xt_tcpmss.o”  。  。
make[1]: *** [scripts/Makefile.build:544:net/netfilter]   2
make[1]: ***  ....
make: *** [Makefile:1052:net]   2
make: ***  ....
dpkg-buildpackage:  :  
dpkg-architecture:  : specified GNU system type mips64el-linux-gnuabi64 does not match CC system type mips-linux-gnu, try setting a correct CC environment variable
 dpkg-source --before-build .
 debian/rules build
make[5]: ***  “net/netfilter/xt_tcpmss.c”, “net/netfilter/xt_tcpmss.o”  。  。
make[4]: *** [scripts/Makefile.build:544:net/netfilter]   2
make[4]: ***  ....
make[3]: *** [Makefile:1052:net]   2
make[3]: ***  ....
make[2]: *** [debian/rules:4:build]   2
dpkg-buildpackage:  : debian/rules build subprocess returned exit status 2
make[1]: *** [scripts/package/Makefile:80:bindeb-pkg]   2
make: *** [Makefile:1365:bindeb-pkg]   2


해결 방법:
sudo cp linux-4.19.134/net/netfilter/xt_tcpmss.c loongson_kernel/net/netfilter/xt_tcpmss.c

**(5) **
 sudo  /bin/bash mk.sh build uosdesktop 2>&1 >/dev/null
net/netfilter/xt_mark.c:16:10: fatal error: linux/netfilter/xt_mark.h: No such file or directory
 #include 
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:309:net/netfilter/xt_mark.o]   1
make[2]: ***  ....
make[1]: *** [scripts/Makefile.build:544:net/netfilter]   2
make[1]: ***  ....
make: *** [Makefile:1052:net]   2
dpkg-buildpackage:  :  
dpkg-architecture:  : specified GNU system type mips64el-linux-gnuabi64 does not match CC system type mips-linux-gnu, try setting a correct CC environment variable
 dpkg-source --before-build .
 debian/rules build
net/netfilter/xt_mark.c:16:10: fatal error: linux/netfilter/xt_mark.h: No such file or directory
 #include 
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[5]: *** [scripts/Makefile.build:309:net/netfilter/xt_mark.o]   1
make[4]: *** [scripts/Makefile.build:544:net/netfilter]   2
make[3]: *** [Makefile:1052:net]   2
make[3]: ***  ....
make[2]: *** [debian/rules:4:build]   2
dpkg-buildpackage:  : debian/rules build subprocess returned exit status 2
make[1]: *** [scripts/package/Makefile:80:bindeb-pkg]   2
make: *** [Makefile:1365:bindeb-pkg]   2


해결 방법:
sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter/xt_mark.h loongson-kernel/include/uapi/linux/netfilter/xt_mark.h

(6)
george@T30:~/tx/version$ sudo  /bin/bash mk.sh build uosdesktop 2>&1 >/dev/null
net/netfilter/xt_connmark.c:28:10: fatal error: linux/netfilter/xt_connmark.h: No such file or directory
 #include 
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:309:net/netfilter/xt_connmark.o]   1
make[2]: ***  ....
make[1]: *** [scripts/Makefile.build:544:net/netfilter]   2
make: *** [Makefile:1052:net]   2
make: ***  ....
dpkg-buildpackage:  :  
dpkg-architecture:  : specified GNU system type mips64el-linux-gnuabi64 does not match CC system type mips-linux-gnu, try setting a correct CC environment variable


해결 방법:
sudo cp ../linux-4.19.134/net/netfilter/xt_rateest.c loongson_kernel/net/netfilter/xt_rateest.c

sudo cp ../linux-4.19.134/net/netfilter/xt_tcpmss.c loongson_kernel/net/netfilter/xt_tcpmss.c

sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter/xt_connmark.h loongson-kernel/include/uapi/linux/netfilter/xt_connmark.h

sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter_ipv4/ipt_ecn.h loongson-kernel/include/uapi/linux/netfilter_ipv4/ipt_ecn.h

sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter_ipv4/ipt_ttl.h loongson-kernel/include/uapi/linux/netfilter_ipv4/ipt_ttl.h

sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter_ipv6/ip6t_hl.h loongson-kernel/include/uapi/linux/netfilter_ipv6/ip6t_hl.h

sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter/xt_rateest.h loongson-kernel/include/uapi/linux/netfilter/xt_rateest.h

sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter/xt_tcpmss.h loongson-kernel/include/uapi/linux/netfilter/xt_tcpmss.h


3. 요약
sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter/xt_dscp.h loongson_kernel/include/uapi/linux/netfilter/xt_dscp.h
sudo cp ../linux_version/linux-4.19.134/net/netfilter/xt_hl.c loongson_kernel/net/netfilter/xt_hl.c
sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter/xt_mark.h loongson-kernel/include/uapi/linux/netfilter/xt_mark.h
sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter/xt_connmark.h loongson-kernel/include/uapi/linux/netfilter/xt_connmark.h
sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter_ipv4/ipt_ecn.h loongson-kernel/include/uapi/linux/netfilter_ipv4/ipt_ecn.h
sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter_ipv4/ipt_ttl.h loongson-kernel/include/uapi/linux/netfilter_ipv4/ipt_ttl.h
sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter_ipv6/ip6t_hl.h loongson-kernel/include/uapi/linux/netfilter_ipv6/ip6t_hl.h
sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter/xt_rateest.h loongson-kernel/include/uapi/linux/netfilter/xt_rateest.h
sudo cp ../linux_version/linux-4.19.134/include/uapi/linux/netfilter/xt_tcpmss.h loongson-kernel/include/uapi/linux/netfilter/xt_tcpmss.h

4, 마지막으로 코어 버전 컴파일 성공
root@T30:/home/george/tx/version# tree -L 1
.
├── linux-headers-4.19.0-loongson-3-desktop_4.19.90-1_mips64el.deb
├── linux-image-4.19.0-loongson-3-desktop_4.19.90-1_mips64el.deb
├── linux-image-4.19.0-loongson-3-desktop-dbg_4.19.90-1_mips64el.deb
├── linux-libc-dev_4.19.90-1_mips64el.deb
├── loongson-kernel
└── mk.sh

좋은 웹페이지 즐겨찾기