[Jool-list] HELP: My custom build doesn't work exactly

Alberto Leiva ydahhrk at gmail.com
Fri Dec 6 12:00:04 CST 2019


The flags are not meant to fix the problem; they are meant to
replicate it without having to install CentOS 5.

The problem is a bug that needs to be fixed from code.

On Fri, Dec 6, 2019 at 11:47 AM Fatih USTA <fatihusta86 at gmail.com> wrote:
>
> I added these FLAGS but not compiled.
>
> make CFLAGS="-m32
> -I/usr/src/redhat/SOURCES/kernel-headers-%{kversion}/usr/include "
> LDFLAGS="-m32"
>
> /bin/sh ../../../libtool  --tag=CC   --mode=compile
> /opt/rh/devtoolset-2/root/usr/bin/gcc -DPACKAGE_NAME=\"Jool\"
> -DPACKAGE_TARNAME=\"jool\" -DPACKAGE_VERSION=\"4.0.6\"
> -DPACKAGE_STRING=\"Jool\ 4.0.6\" -DPACKAGE_BUGREPORT=\"jool at nic.mx\"
> -DPACKAGE_URL=\"\" -DPACKAGE=\"jool\" -DVERSION=\"4.0.6\"
> -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
> -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
> -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
> -DHAVE_ARPA_INET_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
> -DHAVE_UNISTD_H=1 -DHAVE__BOOL=1 -DHAVE_INET_NTOA=1 -DHAVE_MEMSET=1
> -DHAVE_STRCASECMP=1 -DHAVE_STRTOL=1 -DHAVE_DLFCN_H=1
> -DLT_OBJDIR=\".libs/\" -I.    -Wall -pedantic -std=gnu11 -I./../../ -m32
> -I/usr/src/redhat/SOURCES/kernel-headers-3.16.76/usr/include  -MT
> libjoolutil_la-str_utils.lo -MD -MP -MF
> .deps/libjoolutil_la-str_utils.Tpo -c -o libjoolutil_la-str_utils.lo
> `test -f 'str_utils.c' || echo './'`str_utils.c
> libtool: compile:  /opt/rh/devtoolset-2/root/usr/bin/gcc
> -DPACKAGE_NAME=\"Jool\" -DPACKAGE_TARNAME=\"jool\"
> -DPACKAGE_VERSION=\"4.0.6\" "-DPACKAGE_STRING=\"Jool 4.0.6\""
> -DPACKAGE_BUGREPORT=\"jool at nic.mx\" -DPACKAGE_URL=\"\"
> -DPACKAGE=\"jool\" -DVERSION=\"4.0.6\" -DSTDC_HEADERS=1
> -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
> -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
> -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
> -DHAVE_ARPA_INET_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
> -DHAVE_UNISTD_H=1 -DHAVE__BOOL=1 -DHAVE_INET_NTOA=1 -DHAVE_MEMSET=1
> -DHAVE_STRCASECMP=1 -DHAVE_STRTOL=1 -DHAVE_DLFCN_H=1
> -DLT_OBJDIR=\".libs/\" -I. -Wall -pedantic -std=gnu11 -I./../../ -m32
> -I/usr/src/redhat/SOURCES/kernel-headers-3.16.76/usr/include -MT
> libjoolutil_la-str_utils.lo -MD -MP -MF
> .deps/libjoolutil_la-str_utils.Tpo -c str_utils.c  -fPIC -DPIC -o
> .libs/libjoolutil_la-str_utils.o
> str_utils.c: In function 'timeout2str':
> str_utils.c:550:2: error: initializer element is not constant
>    static const unsigned int MILLIS_PER_MIN = 60 * MILLIS_PER_SECOND;
>    ^
> str_utils.c:551:2: error: initializer element is not constant
>    static const unsigned int MILLIS_PER_HOUR = 60 * MILLIS_PER_MIN;
>    ^
>
> if I added "-Os" option to CFLAGS then compiled. But issue not fixed.
>
> make CFLAGS="-m32 -Os
> -I/usr/src/redhat/SOURCES/kernel-headers-%{kversion}/usr/include "
> LDFLAGS="-m32"
>
>
> Fatih USTA
>
> On 6.12.2019 20:22, Alberto Leiva wrote:
> > (Just to clarify: -m32 needs to be added to the userpace tools
> > compilation, not to the kernel modules')
> >
> > On Fri, Dec 6, 2019 at 11:18 AM Alberto Leiva <ydahhrk at gmail.com> wrote:
> >> Replicated in a fully 64-bit system by simply adding -m32 to both
> >> CFLAGS and LDFLAGS. (`make CFLAGS=-m32 LDFLAGS=-m32`)
> >> This is a bug. I'd be thankful if you could submit it to the issue tracker.
> >> Regardless, I will be patching it right now. In a few hours I should
> >> have an estimate on how long it's going to take.
> >>
> >> On Fri, Dec 6, 2019 at 10:26 AM Alberto Leiva <ydahhrk at gmail.com> wrote:
> >>> I'd say the most likely cause is the 32-bit OS on top of the 64-bit
> >>> kernel. I mean I know we're supposed to support it, but I left it out
> >>> of the tests because I already had too much on my plate, and then
> >>> forgot about it. You're the first person attempting this as far as I
> >>> know.
> >>>
> >>> I'll try to replicate it. BRB.
> >>>
> >>> On Fri, Dec 6, 2019 at 9:03 AM Fatih USTA <fatihusta86 at gmail.com> wrote:
> >>>>
> >>>> Hi
> >>>> I builded jool in my old system without dkms. but I have some issues
> >>>>
> >>>> 1- instance name beginning "??" characters
> >>>> 2- instance looking netfilter but I wrote iptables.
> >>>> 3- When I execute the iptables command with jool, iptables returning
> >>>> error. There is not any error message at dimesg.
> >>>>
> >>>> jool kernel modules are builded 64bit arch with my custom kernel.(attached)
> >>>> I builded jool userspace tools 32bit arch like my iptables tools.(I
> >>>> can't attach because too big for mail size.)
> >>>> I patched(attached) for build problem. I don't know those patches are
> >>>> correct.
> >>>>
> >>>> I know this is complicated. But I must be run in this system.
> >>>>
> >>>> Are there any suggestions for me?
> >>>>
> >>>> Some Informations
> >>>>
> >>>> [root at jool ~]# modprobe jool jool_siit
> >>>> [root at jool ~]# lsmod | grep jool
> >>>> jool                    1453  0
> >>>> jool_siit               1382  0
> >>>> jool_common           129819  2 jool,jool_siit
> >>>> nf_defrag_ipv6         23273  2 jool,nf_conntrack_ipv6
> >>>> nf_defrag_ipv4          1758  2 jool,nf_conntrack_ipv4
> >>>> x_tables               25365  31
> >>>> jool,jool_siit,xt_NFLOG,ipt_rpfilter,xt_pkttype,xt_length,xt_NFQUEUE,xt_connmark,xt_CT,xt_addrtype,ebtables,xt_connlimit,xt_hashlimit,xt_nat,xt_mark,iptable_raw,xt_set,ip6t_REJECT,xt_multiport,xt_LOG,xt_limit,xt_tcpudp,xt_conntrack,ip6table_mangle,ip6table_raw,iptable_mangle,xt_recent,ip6table_filter,ip6_tables,iptable_filter,ip_tables
> >>>>
> >>>> [root at jool ~]# jool -V
> >>>> 4.0.6.0
> >>>>
> >>>> issues
> >>>>
> >>>> [root at jool ~]# jool instance add alpha --iptables --pool6 64:ff9b::/96
> >>>>
> >>>> [root at jool ~]# jool instance display
> >>>> +--------------------+-----------------+-----------+
> >>>> |          Namespace |            Name | Framework |
> >>>> +--------------------+-----------------+-----------+
> >>>> |         0x80e868c0 |       ��alpha | netfilter |
> >>>> +--------------------+-----------------+-----------+
> >>>>
> >>>> [root at jool ~]# /sbin/iptables  -t mangle -A PREROUTING -j JOOL
> >>>> --instance "alpha"
> >>>> iptables: Invalid argument. Run `dmesg' for more information.
> >>>>
> >>>> dmesg |tail
> >>>> Jool: Core Jool v4.0.6.0 module inserted.
> >>>> NAT64 Jool v4.0.6.0 module inserted.
> >>>> SIIT Jool v4.0.6.0 module inserted.
> >>>> Jool: Created instance 'alpha'.
> >>>>
> >>>>
> >>>> OS=Centos5 ( I know this is dead. :( )
> >>>> OS_ARCH=32bit
> >>>> KERNEL_ARCH=64bit
> >>>>
> >>>> [root at jool ~]# uname -r
> >>>> 3.16.76-4.custom
> >>>>
> >>>> [root at jool ~]# iptables -V
> >>>> iptables v1.6.0
> >>>>
> >>>> RPM Packages Contains
> >>>> [root at jool ~]# rpm -qlp jool-kmod-4.0.6-1.noarch.rpm
> >>>> /lib/modules/3.16.76-4.custom/jool
> >>>> /lib/modules/3.16.76-4.custom/jool/jool.ko
> >>>> /lib/modules/3.16.76-4.custom/jool/jool_common.ko
> >>>> /lib/modules/3.16.76-4.custom/jool/jool_siit.ko
> >>>>
> >>>> [root at jool ~]# rpm -qlp jool-tools-4.0.6-1.i386.rpm
> >>>> /lib/xtables
> >>>> /lib/xtables/libxt_JOOL.so
> >>>> /lib/xtables/libxt_JOOL_SIIT.so
> >>>> /usr/bin/jool
> >>>> /usr/bin/jool_siit
> >>>> /usr/bin/joold
> >>>> /usr/lib/jool/libjoolargp.so
> >>>> /usr/lib/jool/libjoolargp.so.0
> >>>> /usr/lib/jool/libjoolargp.so.0.0.0
> >>>> /usr/lib/jool/libjoolnl.so
> >>>> /usr/lib/jool/libjoolnl.so.0
> >>>> /usr/lib/jool/libjoolnl.so.0.0.0
> >>>> /usr/lib/jool/libjoolutil.so
> >>>> /usr/lib/jool/libjoolutil.so.0
> >>>> /usr/lib/jool/libjoolutil.so.0.0.0
> >>>> /usr/share/man/man8
> >>>> /usr/share/man/man8/jool.8.gz
> >>>> /usr/share/man/man8/jool_siit.8.gz
> >>>> /usr/share/man/man8/joold.8.gz
> >>>>
> >>>>
> >>>> #gcc 64bit
> >>>> [fatih at centos5-64bit jool-4.0.6]$ /opt/rh/devtoolset-2/root/usr/bin/gcc -v
> >>>> Using built-in specs.
> >>>> COLLECT_GCC=/opt/rh/devtoolset-2/root/usr/bin/gcc
> >>>> COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-CentOS-linux/4.8.2/lto-wrapper
> >>>> Target: x86_64-CentOS-linux
> >>>> Configured with: ../configure --prefix=/opt/rh/devtoolset-2/root/usr
> >>>> --mandir=/opt/rh/devtoolset-2/root/usr/share/man
> >>>> --infodir=/opt/rh/devtoolset-2/root/usr/share/info
> >>>> --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
> >>>> --enable-shared --enable-threads=posix --enable-checking=release
> >>>> --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
> >>>> --disable-gnu-unique-object --enable-linker-build-id
> >>>> --enable-languages=c,c++,fortran,lto --enable-plugin
> >>>> --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj
> >>>> --with-isl=/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-CentOS-linux/isl-install
> >>>> --with-cloog=/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-CentOS-linux/cloog-install
> >>>> --with-gmp=/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-CentOS-linux/gmp-install
> >>>> --with-mpfr=/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-CentOS-linux/mpfr-install
> >>>> --with-mpc=/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-CentOS-linux/mpc-install
> >>>> --with-tune=generic --with-arch_32=i586 --build=x86_64-CentOS-linux
> >>>> Thread model: posix
> >>>> gcc version 4.8.2 20140120 (Red Hat 4.8.2-15) (GCC)
> >>>>
> >>>> #gcc 32bit
> >>>> /opt/rh/devtoolset-2/root/usr/bin/gcc -v
> >>>> Using built-in specs.
> >>>> COLLECT_GCC=/opt/rh/devtoolset-2/root/usr/bin/gcc
> >>>> COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-2/root/usr/libexec/gcc/i386-CentOS-linux/4.8.2/lto-wrapper
> >>>> Target: i386-CentOS-linux
> >>>> Configured with: ../configure --prefix=/opt/rh/devtoolset-2/root/usr
> >>>> --mandir=/opt/rh/devtoolset-2/root/usr/share/man
> >>>> --infodir=/opt/rh/devtoolset-2/root/usr/share/info
> >>>> --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
> >>>> --enable-shared --enable-threads=posix --enable-checking=release
> >>>> --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
> >>>> --disable-gnu-unique-object --enable-linker-build-id
> >>>> --enable-languages=c,c++,fortran,lto --enable-plugin
> >>>> --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj
> >>>> --with-isl=/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-i386-CentOS-linux/isl-install
> >>>> --with-cloog=/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-i386-CentOS-linux/cloog-install
> >>>> --with-gmp=/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-i386-CentOS-linux/gmp-install
> >>>> --with-mpfr=/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-i386-CentOS-linux/mpfr-install
> >>>> --with-mpc=/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-i386-CentOS-linux/mpc-install
> >>>> --with-tune=generic --with-arch=i586 --build=i386-CentOS-linux
> >>>> Thread model: posix
> >>>> gcc version 4.8.2 20140120 (Red Hat 4.8.2-15) (GCC)
> >>>>
> >>>> CFLAGS for tools
> >>>> export CFLAGS="-fPIE -Os -g -pipe -fsigned-char
> >>>> -I/usr/src/redhat/SOURCES/kernel-headers-3.16.76/usr/include"
> >>>>
> >>>> CFLAGS for kernel modules
> >>>> export CFLAGS="-fPIE -Os -g -pipe -fsigned-char"
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Fatih USTA
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> Jool-list mailing list
> >>>> Jool-list at nic.mx
> >>>> https://mail-lists.nic.mx/listas/listinfo/jool-list


More information about the Jool-list mailing list