SalamLang / Salam

Salam Language: The inaugural coding language for Persian and Arabic speakers, inspired by the word salam meaning peace. With a user-friendly approach, it provides an accessible coding experience, promoting collaboration and simplicity for local developers and students.
https://www.salamlang.ir
GNU General Public License v3.0
2 stars 5 forks source link

efence library is missing #142

Open erfangnu opened 1 month ago

erfangnu commented 1 month ago

max@Workstation:~/Salam$ ./b.sh

efence library is missing
Install efence - Electric Fence Malloc Debugger
github-actions[bot] commented 1 month ago

Thank you for your interest in Salam language! We appreciate you opening your first issue. Contributions like yours help make Salam language better.

jbampton commented 1 month ago

https://github.com/SalamLang/Salam/pull/113/files

erfangnu commented 1 month ago

We need a guidline to help users how can install "efence" and "libefence.a"... @janus

erfangnu commented 1 month ago
max@Workstation:~/Salam$ sudo apt install gcc clang llvm
max@Workstation:~/Salam$ ./b.sh
efence library is missing
Install efence - Electric Fence Malloc Debugger
erfangnu commented 1 month ago

https://github.com/boundarydevices/efence

erfangnu commented 1 month ago
max@Workstation:~/Salam$ cd ..
max@Workstation:~$ git clone https://github.com/boundarydevices/efence
Cloning into 'efence'...
remote: Enumerating objects: 39, done.
remote: Total 39 (delta 0), reused 0 (delta 0), pack-reused 39
Receiving objects: 100% (39/39), 35.15 KiB | 274.00 KiB/s, done.
Resolving deltas: 100% (3/3), done.
max@Workstation:~$ cd efence/
max@Workstation:~/efence$ ls -al
total 132
drwxr-xr-x 4 max max  4096 May 29 17:22 .
drwxr-x--- 5 max max  4096 May 29 17:22 ..
-rw-r--r-- 1 max max     0 May 29 17:22 .dummy
drwxr-xr-x 8 max max  4096 May 29 17:22 .git
-rwxr-xr-x 1 max max   653 May 29 17:22 Android.mk
-rwxr-xr-x 1 max max  1045 May 29 17:22 CHANGES
-rwxr-xr-x 1 max max 17982 May 29 17:22 COPYING
-rwxr-xr-x 1 max max  1837 May 29 17:22 Makefile
-rwxr-xr-x 1 max max   906 May 29 17:22 README
drwxr-xr-x 3 max max  4096 May 29 17:22 debian
-rwxr-xr-x 1 max max   403 May 29 17:22 ef.sh
-rwxr-xr-x 1 max max 14078 May 29 17:22 efence.3
-rwxr-xr-x 1 max max 27618 May 29 17:22 efence.c
-rwxr-xr-x 1 max max  1180 May 29 17:22 efence.h
-rwxr-xr-x 1 max max  3875 May 29 17:22 eftest.c
-rwxr-xr-x 1 max max  1991 May 29 17:22 new.c
-rwxr-xr-x 1 max max  4299 May 29 17:22 page.c
-rwxr-xr-x 1 max max  6519 May 29 17:22 print.c
-rwxr-xr-x 1 max max  1240 May 29 17:22 tstheap.c
max@Workstation:~/efence$ make
Command 'make' not found, but can be installed with:
sudo apt install make        # version 4.3-4.1build1, or
sudo apt install make-guile  # version 4.3-4.1build1
max@Workstation:~/efence$ make^C
max@Workstation:~/efence$ sudo apt install make
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  make-doc
The following NEW packages will be installed:
  make
0 upgraded, 1 newly installed, 0 to remove and 101 not upgraded.
Need to get 180 kB of archives.
After this operation, 426 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 make amd64 4.3-4.1build1 [180 kB]
Fetched 180 kB in 0s (386 kB/s)
Selecting previously unselected package make.
(Reading database ... 33864 files and directories currently installed.)
Preparing to unpack .../make_4.3-4.1build1_amd64.deb ...
Unpacking make (4.3-4.1build1) ...
Setting up make (4.3-4.1build1) ...
Processing triggers for man-db (2.10.2-1) ...
max@Workstation:~/efence$ sudo apt install cmake
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  cmake-data dh-elpa-helper emacsen-common libarchive13 libjsoncpp25 librhash0
Suggested packages:
  cmake-doc ninja-build cmake-format lrzip
The following NEW packages will be installed:
  cmake cmake-data dh-elpa-helper emacsen-common libarchive13 libjsoncpp25 librhash0
0 upgraded, 7 newly installed, 0 to remove and 101 not upgraded.
Need to get 7518 kB of archives.
After this operation, 32.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libarchive13 amd64 3.6.0-1ubuntu1 [368 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 libjsoncpp25 amd64 1.9.5-3 [80.0 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy/main amd64 librhash0 amd64 1.4.2-1ubuntu1 [125 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 dh-elpa-helper all 2.0.9ubuntu1 [7610 B]
Get:5 http://archive.ubuntu.com/ubuntu jammy/main amd64 emacsen-common all 3.0.4 [14.9 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 cmake-data all 3.22.1-1ubuntu1.22.04.2 [1913 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 cmake amd64 3.22.1-1ubuntu1.22.04.2 [5010 kB]
Fetched 7518 kB in 14s (549 kB/s)
Selecting previously unselected package libarchive13:amd64.
(Reading database ... 33882 files and directories currently installed.)
Preparing to unpack .../0-libarchive13_3.6.0-1ubuntu1_amd64.deb ...
Unpacking libarchive13:amd64 (3.6.0-1ubuntu1) ...
Selecting previously unselected package libjsoncpp25:amd64.
Preparing to unpack .../1-libjsoncpp25_1.9.5-3_amd64.deb ...
Unpacking libjsoncpp25:amd64 (1.9.5-3) ...
Selecting previously unselected package librhash0:amd64.
Preparing to unpack .../2-librhash0_1.4.2-1ubuntu1_amd64.deb ...
Unpacking librhash0:amd64 (1.4.2-1ubuntu1) ...
Selecting previously unselected package dh-elpa-helper.
Preparing to unpack .../3-dh-elpa-helper_2.0.9ubuntu1_all.deb ...
Unpacking dh-elpa-helper (2.0.9ubuntu1) ...
Selecting previously unselected package emacsen-common.
Preparing to unpack .../4-emacsen-common_3.0.4_all.deb ...
Unpacking emacsen-common (3.0.4) ...
Selecting previously unselected package cmake-data.
Preparing to unpack .../5-cmake-data_3.22.1-1ubuntu1.22.04.2_all.deb ...
Unpacking cmake-data (3.22.1-1ubuntu1.22.04.2) ...
Selecting previously unselected package cmake.
Preparing to unpack .../6-cmake_3.22.1-1ubuntu1.22.04.2_amd64.deb ...
Unpacking cmake (3.22.1-1ubuntu1.22.04.2) ...
Setting up libarchive13:amd64 (3.6.0-1ubuntu1) ...
Setting up emacsen-common (3.0.4) ...
Setting up dh-elpa-helper (2.0.9ubuntu1) ...
Setting up libjsoncpp25:amd64 (1.9.5-3) ...
Setting up librhash0:amd64 (1.4.2-1ubuntu1) ...
Setting up cmake-data (3.22.1-1ubuntu1.22.04.2) ...
Setting up cmake (3.22.1-1ubuntu1.22.04.2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.4) ...
max@Workstation:~/efence$
max@Workstation:~/efence$ make
cc -g -DUSE_SEMAPHORE -fPIC  -c efence.c -o efence.o
cc -g -DUSE_SEMAPHORE -fPIC  -c page.c -o page.o
cc -g -DUSE_SEMAPHORE -fPIC  -c print.c -o print.o
In file included from efence.h:3,
                 from print.c:8:
print.c: In function ‘EF_Printv’:
print.c:218:66: warning: ‘char’ is promoted to ‘int’ when passed through ‘...’
  218 |                                         char    c = va_arg(args, char);
      |                                                                  ^
print.c:218:66: note: (so you should pass ‘int’ not ‘char’ to ‘va_arg’)
print.c:218:66: note: if this code is reached, the program will abort
rm -f libefence.a
ar crv libefence.a efence.o page.o print.o
a - efence.o
a - page.o
a - print.o
gcc -g -shared -Wl,-soname,libefence.so.0 -o libefence.so.0.0 \
        efence.o page.o print.o -lpthread -lc
cc -g -DUSE_SEMAPHORE -fPIC  -c tstheap.c -o tstheap.o
rm -f tstheap
cc -g -DUSE_SEMAPHORE -fPIC tstheap.o libefence.a -o tstheap -lpthread
/usr/bin/ld: libefence.a(page.o): in function `stringErrorReport':
/home/max/efence/page.c:57: undefined reference to `sys_nerr'
/usr/bin/ld: /home/max/efence/page.c:58: undefined reference to `sys_errlist'
collect2: error: ld returned 1 exit status
make: *** [Makefile:62: tstheap] Error 1
max@Workstation:~/efence$ sudo make
rm -f tstheap
cc -g -DUSE_SEMAPHORE -fPIC tstheap.o libefence.a -o tstheap -lpthread
/usr/bin/ld: libefence.a(page.o): in function `stringErrorReport':
/home/max/efence/page.c:57: undefined reference to `sys_nerr'
/usr/bin/ld: /home/max/efence/page.c:58: undefined reference to `sys_errlist'
collect2: error: ld returned 1 exit status
make: *** [Makefile:62: tstheap] Error 1
max@Workstation:~/efence$ sudo make install
install -m 755 ef.sh /usr/bin/ef
install -m 644 libefence.a /usr/lib
install -m 755 libefence.so.0.0 /usr/lib
rm -f /usr/lib/libefence.so.0
ln -s libefence.so.0.0 /usr/lib/libefence.so.0
rm -f /usr/lib/libefence.so
ln -s libefence.so.0.0 /usr/lib/libefence.so
install -m 644 efence.3 /usr/man/man3/efence.3
install: cannot create regular file '/usr/man/man3/efence.3': No such file or directory
make: *** [Makefile:37: install] Error 1
erfangnu commented 1 month ago

An issue created on https://github.com/boundarydevices/efence/issues/2

erfangnu commented 1 month ago

Note: Don't leave libefence.a linked into production software! Use it only for debugging.

erfangnu commented 1 month ago
max@Workstation:~/Salam$ sudo apt install libefence
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libefence
max@Workstation:~/Salam$ sudo apt search libefence
Sorting... Done
Full Text Search... Done