Closed thibaultblf closed 7 years ago
MHD tested on Darwin regularly.
Most likely that your customer used MHD compiled for later OS version than OS installed.
Did you set -mmacosx-version-min=
when building your program? If not - program may fail on previous OS versions.
See
https://gcc.gnu.org/onlinedocs/gcc/Darwin-Options.html
http://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-mmacosx-version-min
http://stackoverflow.com/questions/14268887/what-is-the-illegal-instruction-4-error-and-why-does-mmacosx-version-min-10
Hi, thanks for your reply, but I don't think it's will resolve something because, on my mac, OS Capitan 10.11.6, I have no problem, but user who has the same version has the problem. so it's not depending on OS version. And I have user who has Sierra and have the problem while the application is compiled on Capitan so.. Also, I think, there is something about the network configuration ? because this is the only thing that changes between computers.
Any known issues about this ? hopefully ?
Regards
Now such known issues. Most likely this it compiler problem as it generate instruction which isn't supported by hardware/OS. Try to search more by error description.
And if the instruction is not supported by hardware, What can I do ? Because the flag -mmacosx-version-min= tell the OS but not the hardware. An old hardware can running Sierra OS so, it will be ok for the flag -mmacosx-version-min= but it will still failed as the Hardware is too old to handle the instruction.
For GCC and clang instructions set controlled by -march=cpu-type
:
https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html#x86-Options
http://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-march
Thank for you reply !
I downloaded the source to recompile with the flag -march=cpu-type:
.
But, on source 0.9.52, I try to compile just with default configuration with ./configure;make and it throws this error :
mhd_itc.c:61:23: error: use of undeclared identifier 'pip' (0 != fcntl (pip.fd[i], ^ 1 error generated. make[3]: *** [libmicrohttpd_la-mhd_itc.lo] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
EDIT: I replace 'pip' by 'itc' and it compile fine now
Version 0.9.52 is mostly experimental, I'd recommend to use 0.9.51 until 0.9.53 is released.
OK! In fact, I already try with version 0.9.51 but I had this error :
https_fileserver_example.c:38:10: fatal error: 'gnutls/gnutls.h' file not found
#include <gnutls/gnutls.h>
^
1 error generated.
Quick question, In order to use libmicrohttpd, which level of SSE the processor need to have ? Thank you
The mentioned error comes from failure of building examples. Examples are built only after library, so library itself already compiled.
Did you run configure
script from 0.9.51 version?
Alternatively you can run configure --disable-examples
so examples will be excluded from build.
libmicrohttpd is completely processor-agnostic, no special CPU features are required.
Thank you ! Problem solved here. In fact, my application crashed on Intel Core 2 Duo.. but works on i5, i7....
So I added the flag mtune=generic
in configure.ac, rerun ./configure make make install and now it works fine.
Do you know if on brew, we can add this flag, or we have to download the source ?
Thank you for your help !!
Closed as not related to MHD.
@thibaultblf You should never edit configure.ac to change compiler flags.
There are many ways to change flags for build, most simple and recommended one is to use them as configure
parameters:
./configure CFLAGS='-march=pentium4 -mtune=generic -O2`
where -march=pentium4
means minimal supported processors (only CPU features available on those processor will be used) -mtune=generic
means code generation optimized for average currently available CPU instead of optimization for specific processor and -O2
enables compiler optimizations.
-mtune=generic
alone doesn't prevent usage of features not available on some older CPUs and even if code currently runs on those CPUs (only by pure luck), it's may be changed with any next compilation.
Changing flag in configure.ac
will not change any build flags unless you rerun autoreconf
. If may be done automatically by make
when change of configure.ac
is detected, in this case you will notice second run of configure
script. But, as I said, it's not a proper way to set compiler flags.
I don't use brew, but I suspect that common way of setting compiler flags may work for brew as well:
$ export CFLAGS='-march=pentium4 -mtune=generic -O2`
$ ./configure
I don't think that brew is required for building MHD. You can just download any official version from http://ftp.gnu.org/gnu/libmicrohttpd/, unpack it and run ./configure
Try to search the web for "configure CFLAGS". You'll find required information much faster than asking here.
I have an application programmed in c++ which works fine. However some customer who use it on mac crash it. After some research, turns out the problem come from the libmicrohttpd when MHD_start_daemon is launched.
it returns an error : Illegal instruction: 4 Ps : I can not reproduce the problem it works fine for me....