How to build curl with tcp-fastoption - linux

I have built curl 7.52.1, but I can't use CURLOPT_TCP_FASTOPEN (has added in 7.49)
If I try from command line:
curl --tcp-fastopen -O http://google.com
I get:
curl: (4) A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision.
I suggest I need enable this option in build, but I don't know how.
Did anybody run into this problem?

I have found answer.
My linux(ver 2.6) is too old, it haven't TFO, consequently haven't MSG_FASTOPEN
This define(option) exist on linux 3.6 and higher.
On 3.6-3.12 versions you need to enable this function in kernel.
On 3.13 version and higher this option enabled by default.
For build library on old linux you can write
define MSG_FASTOPEN 0x20000000
But you don't able to use it

Related

How to link to an older version math library?

I'm about to release a library (.so) to my client.
However, my client's platform is a very old debian(9.1 released on 2017).
My libray only works with >= glibc-2.27.
I managed to run program by the following tricks
// copy libm-2.27.so from my computer to the old debian
ln -sf ./libm-2.27.so libm.so.6
gcc ./test.c -o ./test -lmylib -L ./ -lm
LD_LIBRARY_PATH=`pwd` ./test
But my client don't accept this solution.
Is it possible to link to an older version of math library ?
For instance, the client gives me the math library and I link my library against it in my computer.
thanks!
My libray only works with >= glibc-2.27.
Is it because you actually require functionality that was added to GLIBC-2.27, or because you system just happens to have that version installed and you don't know how to build for an older system?
From the comments, it appears that you don't actually need GLIBC-2.27.
In that case, the simplest solution is to install a VM with Debian 9.1 in it, and build you library inside that VM.
This has an added advantage that you can test your library before you ship it to your client, in the environment that matches that of the client.
If you do not want a VM, other solutions are listed here.
I managed to run program by the following tricks ... But my client don't accept this solution.
Your client is smart to reject that solution: it can not generally work, and running in such environment would expose your client to a multitude of potential undefined behaviors and crashes. To understand why this is so, read this answer.

Can we copy curl package and run on Linux without installation

I have old version of curl on linux, I want upgraded the version, but old version is using by others , so i cant upgrade the old one. On windows without installation just copy curl on any drive I am able to run curl, Can i do same thing on linux means just copy the package and run the curl, if yes from where I got the package
Is there any other way? by which old version will not effect
This may need some clarification: are you talking about libcurl or curl itself? (I ask because around the release of Buster I experienced some issues between some programs needing libcurl3 and others wanting libcurl4 on Debian). Is this what you mean, or do you just mean an older version of curl itself? And in particular, how old and what programs are requiring it because you may be able to just update the repos and have everything run off of the newest versions.
if you're using a standard dynamically-compiled curl, then it's tricky because it will try to load the old libcurl from /usr/lib/x86_64-linux-gnu/libcurl.so.4 or something like that, but a statically compiled curl? you can just download it and put it wherever you want, it's standalone and static after all.
following the instructions from https://stackoverflow.com/a/56394968/1067003 with compiler flags "-s -Os" to tell the compiler to optimize for size, here is a statically compiled 64bit linux curl version 7.65.0 with httpS support via statically compiled openssl version 1.1.1c, which is xz-compressed and base64-encoded: https://pastebin.com/HhMYYQAS
use the following command to decompress it:
wget -O- 'https://pastebin.com/raw/HhMYYQAS' | base64 -d | xz -d > curl_static;chmod +x curl_static;
(i can't inline the base64 because it's too big for stackoverflow answers)
You can try out the static curl library:
https://github.com/moparisthebest/static-curl
I tried it on an old system, and it works wonder.
Even better is that build script is provided, so you can build it yourself if using third party binary is a concern.

How to update xorriso?

I am trying to learn more about operating system and am following this tutorial: https://youtu.be/ZiHtuBnVrx4?list=PLHh55M_Kq4OApWScZyPl5HhgsTJS9MZ6M. Everything was going smoothly until the point where I had to use grub-mkresuce to create an iso image to use with a virtual box. I am getting an error saying "your xorriso doesnt support '--grub2-boot-info'. Some features are disabled. Please use xorriso 1.2.9 or later.."
I am left confused and without an iso image. I have looked online for a solution but failed to find any. Any help will be greatly appreciated.
if your operating system does not offer a package "xorriso" or "libisoburn",
or if they are older than version 1.2.9 (1.3.0 was released in 2013), then
download and compile GNU xorriso. (MS-Windows users may need Cygwin to get
the necessary compiler and linker tools.)
cd ...some.work.directory...
wget https://www.gnu.org/software/xorriso/xorriso-1.5.0.tar.gz
tar xzf xorriso-1.5.0.tar.gz
cd xorriso-1.5.0
./configure && make
Check whether the result is willing to work:
xorriso/xorriso
which should say
GNU xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.
usage : xorriso/xorriso [commands]
More is told by command -help
You do not need to install it. Rather obtain its absolute address:
ls $(pwd)/xorriso/xorriso
and use it with the grub-mkrescue option "--xorriso=":
grub-mkrescue --xorriso=...absolute.address.of.xorriso...
Have a nice day :)

IOMMU Emulation and install with QEMU

For now, I need to use some packages to do a emulation for IOMMU (it is similar to MMU), and I got some source about it, but I don't know how to use them.
http://www.spinics.net/lists/kvm/msg38514.html Here is a link of source for emulating IOMMU
http://repo.or.cz/w/qemu-kvm/amd-iommu.git Here is a link for downloading file for this emulation
My problem is how to use qemu to do this and there are so many file in the download list, I don't know how to use them...
Thanks for your help, really appreciate!!! If you know something detail, please tell me
you can use download option in the right side of the page ( Generally snapshot option is available in repositories )
or this
then simply use configure script to generate makefile
i.e.
use ccache if you want to recompile it again and again
$CC="ccache gcc"./configure --prefix=$PREFIX <br>
then make to build and install, use -j<no_of_cpu+1>
$make -j5 all install
if you have dependencies issue, solve them using synaptic manager or apt-get
P.S. AFAIK You should have iommu support available in hardware, if you have 64-bit machine then you might have. You can check flags in using cat /proc/cpuinfo

Network time protocol (NTP)

I have found a simulator called ntpdsim for NTP: http://www.eecis.udel.edu/~mills/ntp/html/ntpdsim_new.html
I canot figure out on what OS I can use it. On the page there is no download content. So I thought it is integrated in the NTP package.
I have tried Ubuntu and Opensuse. On both I have installed NTP, but there is no program called ntpdsim.
How can I use this tool?
ntpdsim is indeed part of the ntp source tarball, however apparently not included in the distribution packages you cite.
When compiling from source, you need to run ./configure with --enable-simulator to build/install it. That's at least what ./configure --help says.
Check ./configure --help to see if there's a build option you need to enable.
I think this is what you're looking for : http://doc.ntp.org/4.2.2p1/ntpdsim.html

Resources