Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to build without submodules #63

Open
zorun opened this issue Sep 16, 2018 · 10 comments
Open

Allow to build without submodules #63

zorun opened this issue Sep 16, 2018 · 10 comments

Comments

@zorun
Copy link

zorun commented Sep 16, 2018

Currently, tracebox tries to import libcrafter as a git submodule.

This is a blocking issue for integrating this software in a distro (Arch Linux in my case):

  • it prevents reproducible builds
  • when building from a tarball, the submodules just won't work

Is it possible to add an option to use a system-wide libcrafter installation instead of a submodule?

See also pellegre/libcrafter#56

@oliviertilmans
Copy link
Member

Hi @zorun ,

This should be achievable by tweaking the configure.ac to add an additional --with-... argument.
Dealing with API changes will however likely be much harder, given the pace of libcrafter new releases (unless you want to always build upon its git head, which is implictly the same as building it statically)

Unfortunately, I will not have any time to do and test this before October.

@arinc9
Copy link

arinc9 commented May 15, 2020

Late to the party. I'm trying to compile tracebox for OpenWRT and libcrafter produces an issue that I don't understand.

---
/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-8.4.0_musl_eabi/include/fortify/wchar.h:34:2: warning: #include_next is a GCC extension
 #include_next <wchar.h>
  ^~~~~~~~~~~~
In file included from /home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/include/uClibc++/fstream:32,
                 from /home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/include/uClibc++/iostream:29,
                 from crafter/Protocols/../Layer.h:32,
                 from crafter/Protocols/RawLayer.h:32,
                 from crafter/Protocols/DNS.h:38,
                 from crafter/Protocols/DNSQuery.cpp:35:
/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-8.4.0_musl_eabi/include/fortify/unistd.h:22:2: warning: #include_next is a GCC extension
 #include_next <unistd.h>
  ^~~~~~~~~~~~
crafter/Protocols/DNSQuery.cpp: In member function 'size_t Crafter::DNS::DNSQuery::Compress()':
crafter/Protocols/DNSQuery.cpp:95:15: error: 'ns_name_compress' was not declared in this scope
  int nbytes = ns_name_compress(qname.c_str(),cqname,NS_MAXCDNAME,0,0);
               ^~~~~~~~~~~~~~~~
crafter/Protocols/DNSQuery.cpp:95:15: note: suggested alternative: 'ns_name_uncompress'
  int nbytes = ns_name_compress(qname.c_str(),cqname,NS_MAXCDNAME,0,0);
               ^~~~~~~~~~~~~~~~
               ns_name_uncompress
make[8]: *** [Makefile:1042: crafter/Protocols/DNSQuery.lo] Error 1
make[8]: Leaving directory '/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/tracebox-0.2/noinst/libcrafter/libcrafter'
make[7]: *** [Makefile:593: all] Error 2
make[7]: Leaving directory '/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/tracebox-0.2/noinst/libcrafter/libcrafter'
make[6]: *** [Makefile:634: all-local] Error 2
make[6]: Leaving directory '/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/tracebox-0.2/noinst'
make[5]: *** [Makefile:366: all-recursive] Error 1
make[5]: Leaving directory '/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/tracebox-0.2/noinst'
make[4]: *** [Makefile:413: all-recursive] Error 1
make[4]: Leaving directory '/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/tracebox-0.2'
make[3]: *** [Makefile:345: all] Error 2
make[3]: Leaving directory '/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/tracebox-0.2'
make[2]: *** [Makefile:60: /home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/tracebox-0.2/.built] Error 2
make[2]: Leaving directory '/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/feeds/tracebox/tracebox'
time: package/feeds/tracebox/tracebox/compile#0.67#1.14#1.91
make[1]: *** [package/Makefile:113: package/feeds/tracebox/tracebox/compile] Error 2
make[1]: Leaving directory '/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64'
make: *** [/home/arinc9/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64/include/toplevel.mk:213: package/tracebox/compile] Error 2
arinc9@arinc9-PC:~/openwrt-sdk-mvebu-cortexa9_gcc-8.4.0_musl_eabi.Linux-x86_64$

@oliviertilmans
Copy link
Member

Hi,

Could you check that you have libresolv available with your musl setup?

@arinc9
Copy link

arinc9 commented May 27, 2020

Thank you very much for getting back at me. Looking at musl 1.1.24 manual, I figured libresolv.a is an empty library archive. https://musl.libc.org/doc/1.1.24/manual.html

Under Development environment:

Additional files libm.a, librt.a, libpthread.a, libcrypt.a, libutil.a, libxnet.a, libresolv.a, and libdl.a are provided in $(libdir) as empty library archives. They contain no code, but are present to satisfy the POSIX requirement that options of the form -lm, -lpthread, etc. be accepted by the c99 compiler.

I'm not sure what to do. Any ideas?

@oliviertilmans
Copy link
Member

oliviertilmans commented May 27, 2020 via email

@arinc9
Copy link

arinc9 commented May 27, 2020

I see. There’s only tracebox 0.2 for OpenWRT if I understand correctly. I think I’m better off using tracebox build on regular linux. Both for the reasons of compiling and it being the old version. I’d rather use the latest version of tracebox. Thank you for your help.

@oliviertilmans
Copy link
Member

oliviertilmans commented May 28, 2020 via email

@alicektx
Copy link

alicektx commented May 6, 2021

Looking at musl 1.1.24 manual...

...indeed, sadly libcrafter doesn't build against musl no matter what... :-/
As an alternative of sorts, you might be interested in having a look at tracemore
(it builds fine with musl under x86_64 in a common desktop, so i assume under OpenWRT as well?)...

@alicektx
Copy link

...gave it another shot with clearer mind today,
and succeeded in building libcrafter (and thereby tracebox - hurray!) against musl.
Simply replacing in DNSQuery.cpp & DNSAnswer.cpp,
the few instances of ns_name_compress with dn_comp did the trick here...

@oliviertilmans
Copy link
Member

If you can provide a patch doing this switch through e.g., some configure.ac detection, and file it against libcrafter, I'd be happy to merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants