Page MenuHomeFreeBSD

Allow running lorder.sh on Linux
AbandonedPublic

Authored by arichardson on Aug 7 2020, 2:48 PM.
Tags
None
Referenced Files
F82183686: D25989.id75559.diff
Fri, Apr 26, 6:22 AM
F82166505: D25989.id.diff
Fri, Apr 26, 3:18 AM
F82157891: D25989.diff
Fri, Apr 26, 1:07 AM
F82144499: D25989.diff
Thu, Apr 25, 10:16 PM
Unknown Object (File)
Sat, Apr 20, 6:09 PM
Unknown Object (File)
Mar 4 2024, 9:45 PM
Unknown Object (File)
Jan 3 2024, 2:06 AM
Unknown Object (File)
Dec 20 2023, 6:02 AM
Subscribers

Details

Reviewers
emaste
Summary

The glibc regex implementation doesn't like the :>: expression and
therefore we end up with a syntax error due to the empty expression. Fix
this by adding quotes and a || echo 0.

Test Plan

expr now prints a warning for every dir when building on linux instead of aborting the build.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32840
Build 30250: arc lint + arc unit

Event Timeline

arichardson created this revision.

So this avoids failing the build, but the script does not work completely correctly?

So this avoids failing the build, but the script does not work completely correctly?

Yeah this is not the same. However, I believe lorder is no longer required with recent (> 1990) linkers+ar/ranlib that generates an index, so lorder not producing the correct order probably doesn't matter in practice (https://www.gnu.org/software/coreutils/manual/html_node/tsort-background.html)
Also: The lorder command is essentially obsolete. Use the following command in its place: % ar -ts file.a (https://www.unix.com/man-page/osf1/1/lorder/)

I also wonder if we could skip the separate ranlib step and simply use ar to simplify building of static libraries and avoid lots of forked child processes for each .a file.

lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS}
	@${ECHO} building static ${LIB} library
	@rm -f ${.TARGET}
	${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \
	    ${LORDER} ${OBJS} ${STATICOBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD}
	${RANLIB} ${RANLIBFLAGS} ${.TARGET}

->

lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS}
	@${ECHO} building static ${LIB} library
	@rm -f ${.TARGET}
	${AR} ${ARFLAGS} ${.TARGET} ${OBJS} ${STATICOBJS} ${ARADD}

If we add s to ARFLAGS.

I'm fine with this with a comment above the || echo 0 bit (i.e., a short version of what you wrote in your last Phab comment). @imp has been doing lots of Unix archaeology and might have a comment.