Jump to content
Форум по продукции MOXA

moxa NPort6650-16 не собирается драйвер для Fedora34 Linux


Recommended Posts

Скачаный с оф сайта файл исходников: moxa-real-tty-drivers-for-linux-kernel-5.x-v5.1.tgz

1. Попытка первая

Linux version: Fedora 35,
в среде virtual machine VBOX 6.3.
kernel: 5.15.6-100.fc34.x86_64
gcc: 11.2.1 20210728 (Red Hat 11.2.1-1)

Установка: ./mxinst SP1_m64

Без поддержки ssl

ошибки:=========

 /home/user/Downloads/MOXA-6650-16/moxa5.1/moxa/npreal2.o
/home/user/Downloads/MOXA-6650-16/moxa5.1/moxa/npreal2.c:490:31:
error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from
incompatible pointer type ‘int (*)(struct tty_struct *)’
[-Werror=incompatible-pointer-types]
  490 |                 .write_room = npreal_write_room,

=======

Ошибок таких много

 

2. Попытка вторая

Linux version: Ubuntu 18.04,
в среде virtual machine VBOX 6.3.
kernel: 5.00.25-generic (x86-64)
gcc:  7.4.0-lubuntu~18.04.1

Установка: ./mxinst SP1_m64

C поддержкой ssl

Сборка и установка успешные.

 

Но нужно собрать под Fedora34 (35)

Исходники одинаковы совершенно.

1. В чем причина появления ошибок?

Не соответствующий h идер? строгости более позднего компилятора? Отсутствие каких-то вещей в более поздней версии ядра?

2. Как поправить и решить сборку более правильно?

Link to comment
Building driver...

If you want to use secure communication with target,
you might choose [y] to enable the SSL function.
Note: This function support RealCOM with secure mode only.
Do you want to enable secure function? [y/N].
n
make -C /lib/modules/5.15.6-100.fc34.x86_64/build M=/home/user/WORK/moxa2/moxa EXTRA_CFLAGS=" -DTTYNAME='"ttyr"'" modules
make[1]: Entering directory '/usr/src/kernels/5.15.6-100.fc34.x86_64'
  CC [M]  /home/user/WORK/moxa2/moxa/npreal2.o
/home/user/WORK/moxa2/moxa/npreal2.c:490:31: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  490 |                 .write_room = npreal_write_room,
      |                               ^~~~~~~~~~~~~~~~~
/home/user/WORK/moxa2/moxa/npreal2.c:490:31: note: (near initialization for ‘mpvar_ops.write_room’)
/home/user/WORK/moxa2/moxa/npreal2.c:491:36: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  491 |                 .chars_in_buffer = npreal_chars_in_buffer,
      |                                    ^~~~~~~~~~~~~~~~~~~~~~
/home/user/WORK/moxa2/moxa/npreal2.c:491:36: note: (near initialization for ‘mpvar_ops.chars_in_buffer’)
/home/user/WORK/moxa2/moxa/npreal2.c: In function ‘npreal2_module_exit’:
/home/user/WORK/moxa2/moxa/npreal2.c:570:9: error: implicit declaration of function ‘put_tty_driver’ [-Werror=implicit-function-declaration]
  570 |         put_tty_driver(DRV_VAR);
      |         ^~~~~~~~~~~~~~
/home/user/WORK/moxa2/moxa/npreal2.c: In function ‘npreal_init’:
/home/user/WORK/moxa2/moxa/npreal2.c:663:25: error: implicit declaration of function ‘alloc_tty_driver’ [-Werror=implicit-function-declaration]
  663 |         npvar_sdriver = alloc_tty_driver(NPREAL_PORTS+1);
      |                         ^~~~~~~~~~~~~~~~
/home/user/WORK/moxa2/moxa/npreal2.c:663:23: warning: assignment to ‘struct tty_driver *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  663 |         npvar_sdriver = alloc_tty_driver(NPREAL_PORTS+1);
      |                       ^
/home/user/WORK/moxa2/moxa/npreal2.c: In function ‘npreal_close’:
/home/user/WORK/moxa2/moxa/npreal2.c:1065:34: error: ‘struct task_struct’ has no member named ‘state’; did you mean ‘__state’?
 1065 |                         current->state = TASK_INTERRUPTIBLE;
      |                                  ^~~~~
      |                                  __state
/home/user/WORK/moxa2/moxa/npreal2.c: In function ‘npreal_ldisc_flush_buffer’:
/home/user/WORK/moxa2/moxa/npreal2.c:1326:18: error: ‘struct task_struct’ has no member named ‘state’; did you mean ‘__state’?
 1326 |         current->state = TASK_INTERRUPTIBLE;
      |                  ^~~~~
      |                  __state
/home/user/WORK/moxa2/moxa/npreal2.c: In function ‘npreal_ioctl’:
/home/user/WORK/moxa2/moxa/npreal2.c:1434:26: error: ‘struct task_struct’ has no member named ‘state’; did you mean ‘__state’?
 1434 |                 current->state = TASK_RUNNING;
      |                          ^~~~~
      |                          __state
/home/user/WORK/moxa2/moxa/npreal2.c: In function ‘npreal_block_til_ready’:
/home/user/WORK/moxa2/moxa/npreal2.c:1755:18: error: ‘struct task_struct’ has no member named ‘state’; did you mean ‘__state’?
 1755 |         current->state = TASK_RUNNING;
      |                  ^~~~~
      |                  __state
/home/user/WORK/moxa2/moxa/npreal2.c: In function ‘npreal_startup’:
/home/user/WORK/moxa2/moxa/npreal2.c:1792:18: error: ‘struct task_struct’ has no member named ‘state’; did you mean ‘__state’?
 1792 |         current->state = TASK_RUNNING;
      |                  ^~~~~
      |                  __state
/home/user/WORK/moxa2/moxa/npreal2.c:1939:34: error: ‘struct task_struct’ has no member named ‘state’; did you mean ‘__state’?
 1939 |                         current->state = TASK_INTERRUPTIBLE;
      |                                  ^~~~~
      |                                  __state
/home/user/WORK/moxa2/moxa/npreal2.c: In function ‘npreal_shutdown’:
/home/user/WORK/moxa2/moxa/npreal2.c:2052:26: error: ‘struct task_struct’ has no member named ‘state’; did you mean ‘__state’?
 2052 |                 current->state = TASK_INTERRUPTIBLE;
      |                          ^~~~~
      |                          __state
/home/user/WORK/moxa2/moxa/npreal2.c: In function ‘npreal_wait_and_set_command’:
/home/user/WORK/moxa2/moxa/npreal2.c:3935:34: error: ‘struct task_struct’ has no member named ‘state’; did you mean ‘__state’?
 3935 |                         current->state = TASK_INTERRUPTIBLE;
      |                                  ^~~~~
      |                                  __state
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:277: /home/user/WORK/moxa2/moxa/npreal2.o] Error 1
make[1]: *** [Makefile:1872: /home/user/WORK/moxa2/moxa] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.15.6-100.fc34.x86_64'
make: *** [Makefile:75: module] Error 2

FAILED !!! Please check above message.

 

Link to comment
  • 3 weeks later...

 

1. Linux fedora 5.15.6-100.fc34.x86_64 #1 SMP Wed Dec 1 13:41:51 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

2. 

glibc-devel-2.33-20.fc34.x86_64
libxcrypt-devel-4.4.26-2.fc34.x86_64
zlib-devel-1.2.11-26.fc34.x86_64
libstdc++-devel-11.2.1-1.fc34.x86_64
elfutils-libelf-devel-0.186-1.fc34.x86_64
openssl-devel-1.1.1l-2.fc34.x86_64
kernel-devel-5.15.6-100.fc34.x86_64
libxcrypt-devel-4.4.26-2.fc34.i686
glibc-devel-2.33-20.fc34.i686
libomp-devel-12.0.1-1.fc34.x86_64

3. 

glibc-headers-x86-2.33-20.fc34.noarch
kernel-headers-5.15.4-100.fc34.x86_64

Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...