compilation error

453 views
Skip to first unread message

tarpauwatratar

unread,
Sep 10, 2020, 12:15:52 PM9/10/20
to Harbour Developers
Hi everyone,

I was unable to compile the newest dev version of harbour from sources on my (uname --all):

Linux eLama 5.8.7-arch1-1 #1 SMP PREEMPT Sat, 05 Sep 2020 12:31:32 +0000 x86_64 GNU/Linux

I was forced to modify the src/rtl/arc4.c:

diff --git a/src/rtl/arc4.c b/src/rtl/arc4.c
index 1c00f2a575..acee0bedfe 100644
--- a/src/rtl/arc4.c
+++ b/src/rtl/arc4.c
@@ -56,7 +56,6 @@
     * look for it only with "classic" line of libc's.
     */
 #  if ( ! defined( HB_OS_LINUX ) || ( defined( __GLIBC__ ) || defined( __UCLIBC__ ) ) )
-#     define HAVE_SYS_SYSCTL_H
 #  endif
 #  define HAVE_DECL_CTL_KERN
 #  define HAVE_DECL_KERN_RANDOM


Without this modification a compilation process ends on the following error message:

gcc  -I. -I../../../../../include -W -Wall -O3 -DHB_HAS_PCRE -I/usr/include -DHB_HAS_ZLIB -I/usr/include  -oarc4.o  -c ../../../arc4.c
../../../arc4.c:81:15: fatal error: sys/sysctl.h: No such file or directory
   81 | #     include <sys/sysctl.h>
      |               ^~~~~~~~~~~~~~
compilation terminated.

This modification is ugly but it works - I was able to compile hello.prg and dbu files. 

I was also unable to use my old version of harbour which was compiled about one year ago. I don't remember the error message but it was related to the sysctl and lacking function. In the arc4.c I've found:

   /*
    * sysctl() on Linux has fallen into depreciation. Newer generations
    * of runtime C libraries, like musl, doesn't even expose it. Here we
    * look for it only with "classic" line of libc's.
    */


So IMO You know what is wrong and how to repair it better than me ;) 

Aleksander Czajczynski

unread,
Nov 3, 2020, 5:10:35 AM11/3/20
to harbou...@googlegroups.com
Hi!

glibc >= 2.30 now removed what musl predicted, i have finally added some
more brackets to the repo to detect this.
https://github.com/harbour/core/commit/492ae2a79b1a3a95191ac1993b3251180618187c

Best regards, Aleksander

tarpauwatratar wrote:
>
> I was unable to compile the newest dev version of harbour from sources
> on my (uname --all):
>
> Linux eLama 5.8.7-arch1-1 #1 SMP PREEMPT Sat, 05 Sep 2020 12:31:32
> +0000 x86_64 GNU/Linux
>
> I was forced to modify the src/rtl/arc4.c:
[...]

Reply all
Reply to author
Forward
0 new messages