HardenedBSD / secadm

HardenedBSD Security Administration
http://hardenedbsd.org/
29 stars 7 forks source link

Fix building on 32bit #12

Closed lattera closed 9 years ago

lattera commented 9 years ago

Due to the way I did the machine-readable ABI versioning, building is broken on 32bit architectures. Discovered on my RPI2. Log:

cc -O -pipe -mfloat-abi=softfp -DHARDENEDBSD -g -O0 -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I/usr/home/shawn/projects/secadm/kmod/../libsecadm -I. -I/sys -fno-common -funwind-tables -ffreestanding -fwrapv -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -Dprintf=freebsd_kprintf -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -mllvm -arm-use-movt=0 -mfpu=none -std=iso9899:1999 -c /usr/home/shawn/projects/secadm/kmod/secadm_sysctl.c -o secadm_sysctl.o /usr/home/shawn/projects/secadm/kmod/secadm_sysctl.c:185:21: warning: comparison of constant 20150414001 with expression of type 'unsigned long' is always true [-Wtautological-constant-out-of-range-compare] if (cmd.sc_version < SECADM_VERSION)


/usr/home/shawn/projects/secadm/kmod/secadm_sysctl.c:192:21: error: implicit conversion from 'unsigned long long' to 'unsigned long' changes value from 20150414001 to 2970544817 [-Werror,-Wconstant-conversion]
        reply.sr_version = SECADM_VERSION;
                         ~ ^~~~~~~~~~~~~~
/usr/home/shawn/projects/secadm/kmod/../libsecadm/secadm.h:34:26: note: expanded from macro 'SECADM_VERSION'
# define SECADM_VERSION                  20150414001UL

```
                                    ^~~~~~~~~~~~~
```

1 warning and 1 error generated.
**\* Error code 1

Stop.
make[1]: stopped in /usr/home/shawn/projects/secadm/kmod
**\* Error code 1

Stop.
make: stopped in /usr/home/shawn/projects/secadm