Bug 186291 - [build] Compilation fail when "device pst" in kernel config on amd64.
Summary: [build] Compilation fail when "device pst" in kernel config on amd64.
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: amd64 (show other bugs)
Version: 10.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-amd64 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-31 07:10 UTC by Ivan Chetyrkin
Modified: 2017-12-31 22:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Chetyrkin 2014-01-31 07:10:00 UTC
When trying to compile my own kernel with "device pst" in configuration file, process fail with message:

cc  -c -O2 -pipe -fno-strict-aliasing  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality  -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror  /usr/src/sys/dev/pst/pst-iop.c
/usr/src/sys/dev/pst/pst-iop.c:197:3: error: cast to 'void (*)(struct iop_softc *, u_int32_t, struct i2o_single_reply *)' from smaller integer type 'u_int32_t' (aka 'unsigned int')
      [-Werror,-Wint-to-pointer-cast]
        ((void (*)(struct iop_softc *, u_int32_t, struct i2o_single_reply *))
         ^
/usr/src/sys/dev/pst/pst-iop.c:419:9: error: cast to 'struct iop_request *' from smaller integer type 'u_int32_t' (aka 'unsigned int') [-Werror,-Wint-to-pointer-cast]
        (struct iop_request *)reply->transaction_context;
        ^
2 errors generated.

As we see from /usr/src/sys/dev/pst/pst-iop.h, initiator_context and transaction_context fields of driver message struct are declared as u_int32_t, which doesn't match pointer size on 64-bit processor.

Fix: 

The controller is very old hardware and one of fix may be exclude it from available devices on amd64 platform.
How-To-Repeat: On amd64 machine include
device pst
in your config file and try compile kernel.
Comment 1 John Baldwin freebsd_committer freebsd_triage 2014-02-06 18:22:52 UTC
> The controller is very old hardware and one of fix may be exclude it from 
available devices on amd64 platform.

Yes, this driver is not supported on amd64.  Do you need it to work?  You 
would need to implement a cookie hash table of some sort to map transaction 
context IDs to request pointers.  If you do not need it, we should probably
disable it on amd64 as no one else has asked about it.

-- 
John Baldwin
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:49 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped