On Sun, Jun 29, 2025 at 07:06:57PM -0700, Steve Kargl wrote:
> On Sun, Jun 29, 2025 at 06:54:53PM -0700, Steve Kargl wrote:
> >
> > /usr/local/bin/ld: cannot find -lcaf_shmem: No such file or directory
> > collect2: error: ld returned 1 exit status
> > compiler exited with status 1
> > 
> > The freshly built gfortran cannot find the libcaf_shmem.a.
> > 
> 
> % find . -name \*libcaf\* | wc -l
>        0
> % pwd
> /home/kargl/gcc/obj
> 
> % find . -name \*shmem\* 
> ./x86_64-unknown-freebsd15.0/libgfortran/caf/.deps/shmem.Plo
> ./x86_64-unknown-freebsd15.0/libgfortran/caf/shmem
> ./x86_64-unknown-freebsd15.0/libgfortran/caf/.libs/shmem.o
> ./x86_64-unknown-freebsd15.0/libgfortran/caf/shmem.o
> ./x86_64-unknown-freebsd15.0/libgfortran/caf/shmem.lo
> 

I'm slowly solving the mystery. 

% gmake -j15 bootstrap | tee sgk.log
% more sgk.log
...
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  /home/kargl/gcc/obj/./gcc/xgcc -B/home/kargl/gcc/obj/./gcc/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/bin/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/lib/ -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/include -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/sys-include -fchecking=1 
-DHAVE_CONFIG_H -I. -I../../../gcc/libgfortran 
-iquote../../../gcc/libgfortran/io -I../../../gcc/libgfortran/../gcc 
-I../../../gcc/libgfortran/../gcc/config 
-I../../../gcc/libgfortran/../libquadmath -I../.././gcc 
-I../../../gcc/libgfortran/../libgcc -I../libgcc 
-I../../../gcc/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace 
-std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition -Wextra -Wwrite-strings 
-Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules 
-ffunction-sections -fdata-sections -O -g -MT caf/shmem/allocator.lo -MD -MP 
-MF caf/shmem/.deps/allocator.Tpo -c 
../../../gcc/libgfortran/caf/shmem/allocator.c  -fPIC -DPIC -o 
caf/shmem/.libs/allocator.o
libtool: compile:  /home/kargl/gcc/obj/./gcc/xgcc -B/home/kargl/gcc/obj/./gcc/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/bin/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/lib/ -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/include -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/sys-include -fchecking=1 
-DHAVE_CONFIG_H -I. -I../../../gcc/libgfortran 
-iquote../../../gcc/libgfortran/io -I../../../gcc/libgfortran/../gcc 
-I../../../gcc/libgfortran/../gcc/config 
-I../../../gcc/libgfortran/../libquadmath -I../.././gcc 
-I../../../gcc/libgfortran/../libgcc -I../libgcc 
-I../../../gcc/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace 
-std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition -Wextra -Wwrite-strings 
-Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules 
-ffunction-sections -fdata-sections -O -g -MT 
caf/shmem/collective_subroutine.lo -MD -MP -MF 
caf/shmem/.deps/collective_subroutine.Tpo -c 
../../../gcc/libgfortran/caf/shmem/collective_subroutine.c  -fPIC -DPIC -o 
caf/shmem/.libs/collective_subroutine.o
libtool: compile:  /home/kargl/gcc/obj/./gcc/xgcc -B/home/kargl/gcc/obj/./gcc/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/bin/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/lib/ -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/include -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/sys-include -fchecking=1 
-DHAVE_CONFIG_H -I. -I../../../gcc/libgfortran 
-iquote../../../gcc/libgfortran/io -I../../../gcc/libgfortran/../gcc 
-I../../../gcc/libgfortran/../gcc/config 
-I../../../gcc/libgfortran/../libquadmath -I../.././gcc 
-I../../../gcc/libgfortran/../libgcc -I../libgcc 
-I../../../gcc/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace 
-std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition -Wextra -Wwrite-strings 
-Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules 
-ffunction-sections -fdata-sections -O -g -MT caf/shmem/counter_barrier.lo -MD 
-MP -MF caf/shmem/.deps/counter_barrier.Tpo -c 
../../../gcc/libgfortran/caf/shmem/counter_barrier.c  -fPIC -DPIC -o 
caf/shmem/.libs/counter_barrier.o
libtool: compile:  /home/kargl/gcc/obj/./gcc/xgcc -B/home/kargl/gcc/obj/./gcc/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/bin/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/lib/ -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/include -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/sys-include -fchecking=1 
-DHAVE_CONFIG_H -I. -I../../../gcc/libgfortran 
-iquote../../../gcc/libgfortran/io -I../../../gcc/libgfortran/../gcc 
-I../../../gcc/libgfortran/../gcc/config 
-I../../../gcc/libgfortran/../libquadmath -I../.././gcc 
-I../../../gcc/libgfortran/../libgcc -I../libgcc 
-I../../../gcc/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace 
-std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition -Wextra -Wwrite-strings 
-Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules 
-ffunction-sections -fdata-sections -O -g -MT caf/shmem/hashmap.lo -MD -MP -MF 
caf/shmem/.deps/hashmap.Tpo -c ../../../gcc/libgfortran/caf/shmem/hashmap.c  
-fPIC -DPIC -o caf/shmem/.libs/hashmap.o
In file included from ../../../gcc/libgfortran/caf/shmem/allocator.h:31,
                 from ../../../gcc/libgfortran/caf/shmem/alloc.h:28,
                 from ../../../gcc/libgfortran/caf/shmem/alloc.c:29:
../../../gcc/libgfortran/caf/shmem/shared_memory.h:88:29: error: unknown type 
name 'pid_t'
   88 | void shared_memory_set_env (pid_t pid);
      |                             ^~~~~
libtool: compile:  /home/kargl/gcc/obj/./gcc/xgcc -B/home/kargl/gcc/obj/./gcc/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/bin/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/lib/ -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/include -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/sys-include -fchecking=1 
-DHAVE_CONFIG_H -I. -I../../../gcc/libgfortran 
-iquote../../../gcc/libgfortran/io -I../../../gcc/libgfortran/../gcc 
-I../../../gcc/libgfortran/../gcc/config 
-I../../../gcc/libgfortran/../libquadmath -I../.././gcc 
-I../../../gcc/libgfortran/../libgcc -I../libgcc 
-I../../../gcc/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace 
-std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition -Wextra -Wwrite-strings 
-Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules 
-ffunction-sections -fdata-sections -O -g -MT caf/shmem/shared_memory.lo -MD 
-MP -MF caf/shmem/.deps/shared_memory.Tpo -c 
../../../gcc/libgfortran/caf/shmem/shared_memory.c  -fPIC -DPIC -o 
caf/shmem/.libs/shared_memory.o
../../../gcc/libgfortran/caf/shmem/allocator.h:40:3: error: unknown type name 
'pthread_mutex_t'
   40 |   pthread_mutex_t lock;
      |   ^~~~~~~~~~~~~~~
libtool: compile:  /home/kargl/gcc/obj/./gcc/xgcc -B/home/kargl/gcc/obj/./gcc/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/bin/ 
-B/home/kargl/work/x/x86_64-unknown-freebsd15.0/lib/ -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/include -isystem 
/home/kargl/work/x/x86_64-unknown-freebsd15.0/sys-include -fchecking=1 
-DHAVE_CONFIG_H -I. -I../../../gcc/libgfortran 
-iquote../../../gcc/libgfortran/io -I../../../gcc/libgfortran/../gcc 
-I../../../gcc/libgfortran/../gcc/config 
-I../../../gcc/libgfortran/../libquadmath -I../.././gcc 
-I../../../gcc/libgfortran/../libgcc -I../libgcc 
-I../../../gcc/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace 
-std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition -Wextra -Wwrite-strings 
-Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules 
-ffunction-sections -fdata-sections -O -g -MT caf/shmem/supervisor.lo -MD -MP 
-MF caf/shmem/.deps/supervisor.Tpo -c 
../../../gcc/libgfortran/caf/shmem/supervisor.c  -fPIC -DPIC -o 
caf/shmem/.libs/supervisor.o
In file included from ../../../gcc/libgfortran/caf/shmem/alloc.h:29:
../../../gcc/libgfortran/caf/shmem/hashmap.h:55:3: error: unknown type name 
'ssize_t'; did you mean 'rsize_t'?
   55 |   ssize_t res_offset;
      |   ^~~~~~~
      |   rsize_t
In file included from ../../../gcc/libgfortran/caf/shmem/allocator.h:31,
                 from ../../../gcc/libgfortran/caf/shmem/alloc.h:28,
                 from 
../../../gcc/libgfortran/caf/shmem/collective_subroutine.h:28,
                 from 
../../../gcc/libgfortran/caf/shmem/collective_subroutine.c:25:
../../../gcc/libgfortran/caf/shmem/shared_memory.h:88:29: error: unknown type 
name 'pid_t'
   88 | void shared_memory_set_env (pid_t pid);
      |                             ^~~~~
../../../gcc/libgfortran/caf/shmem/allocator.h:40:3: error: unknown type name 
'pthread_mutex_t'
   40 |   pthread_mutex_t lock;
      |   ^~~~~~~~~~~~~~~
In file included from ../../../gcc/libgfortran/caf/shmem/alloc.h:29:
../../../gcc/libgfortran/caf/shmem/hashmap.h:55:3: error: unknown type name 
'ssize_t'; did you mean 'rsize_t'?
   55 |   ssize_t res_offset;
      |   ^~~~~~~
      |   rsize_t

There seem to be numerous linuxism in the code.  pid_t
and ssize_t are in /usr/include/unistd.h.  pthread_mutex_t
is in /usr/include/pthread.h.  A quick glance at allocator.h
that pthread_mutex_t is available through header file pollution.



-- 
Steve

Reply via email to