# http://www.berklix.org/~jhs/src/bsd/fixes/freebsd/src/jhs/Makefile.local
# Personal fixes & diagnostiscs etc
# Included by:
# http://www.berklix.org/~jhs/src/bsd/fixes/freebsd/src/gen/Makefile.local.REL=ALL.diff

fix_libgcc_s:
	@echo "This is $@ in http://www.berklix.org/~jhs/src/bsd/fixes/freebsd/src/jhs/Makefile.local"
	@echo "To Fix /usr/src/lib/libgcc_s"
	@echo "See Also:"
	@echo " ls ~/mail/tech/libgcc_s"
	@echo " vi -c/gcc_s ~/bin/.sh/syntax ~/public_html/hardware/laptops/shrink/index.lmth"
	@#
	touch /tmp/libc.a.list
	cd /usr/obj/`cd /usr/src ; /bin/pwd`/`uname -m`.`uname -m` && \
		/bin/pwd && \
		/bin/pwd >> /tmp/libc.a.list && \
		ls -l  `find -s . -name \*libc.a\*` && \
		ls -l  `find -s . -name \*libc.a\*` >> /tmp/libc.a.list && \
		mv lib/libc/libc.a lib/libc/libc.a.`date -u +%Y-%m-%dT%H:%M:%SZ`
	@#    17167616 ./lib/libc/libc.a
	@#    12192630 ./obj-lib32/lib/libc/libc.a
	@#    12192630 ./obj-lib32/tmp/usr/lib32/libc.a
	cd /usr/src/lib/libgcc_s	&& make -B -j 1
	cd /usr/src/lib			&& make -B -j 1
	cd /usr/src			&& make -B -j 1 all
	# -------
	# Breakage in /usr/src/lib/libgcc_s/ :
	#   building shared library libgcc_s.so.1
	#   cc	-nodefaultlibs -Wl,--version-script=Version.map
	#    -shared -Wl,-x -Wl,--fl-warnings -Wl,--warn-shared-textrel
	#    -o libgcc_s.so.1.full -Wl,-soname,libgc.so.1  `NM='nm'
	#    NMFLAGS='' lorder absvdi2.pico .... s_scalbnl.pico
	#    | tsort -q` \
	#    -L/data/releas1/usr/obj/usr/src/amd64.amd64/lib/libc -lc
	# I thought this was obsolete, some old problem back in
	# May 2019, only needed for src/ trees missing sym links,
	# on src/ delivered by old ctm ?  pre fix of ctm for sym
	# links But CTM was fixed for sym links back in Sept 2020;
	# & Sept 2021 with a src/ built not from ctm but from git,
	# I'm still seeing this problem with same fix needed.
	# These did not solve the problem:
	#	mergemaster -iF
	#	removed src.conf & make.conf
	#	source `which unsetenv.csh` 
	#	generic uncustomised src/ 
