Skip to content

Commit 3616f58

Browse files
committed
Improve -DNO_SHORT_NAMES handling
This option has been broken for a long time, but this commit goes a long way to fixing that. It works by creating a new file long_names.c that is automatically generated by regen/embed.pl. This file contains the API elements that normally are macros that don't have a separate long name. when NO_SHORT_NAMES is defined, those macros are suppressed, and instead the long-name functions in this file get compiled The next yak (maybe the only one) needing to be shaved after this is inline functions that use short names. Since they currently are included in the user space, those short names need to be defined, but we'rev compiling without short names, so it doesn't work. We could require inline functions to use long names, but I don't like that, and I suspect you don't either. To me, the easiest other option is to just not have inline functions outside the core when short names are forbidden. We could easily convert them from being inline, and only include them from long_names.c. Thus they would become like any other function in the file.
1 parent 36938dd commit 3616f58

File tree

10 files changed

+1803
-723
lines changed

10 files changed

+1803
-723
lines changed

Cross/Makefile-cross-SH

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,14 @@ h = $(h1) $(h2) $(h3) $(h4) $(h5)
342342
c1 = av.c scope.c op.c doop.c doio.c dquote.c dump.c gv.c hv.c mg.c reentr.c mro_core.c perl.c
343343
c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c sv.c
344344
c3 = taint.c time64.c toke.c util.c deb.c run.c universal.c pad.c globals.c keywords.c
345-
c4 = perlio.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c
345+
c4 = perlio.c numeric.c mathoms.c locale.c long_names.c pp_pack.c pp_sort.c
346346
c5 = $(mallocsrc)
347347
348348
c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c perlmain.c opmini.c
349349
350350
obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dquote$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro_core$(OBJ_EXT)
351351
obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) perl$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
352-
obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) time64$(OBJ_EXT)
352+
obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) long_names($OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) time64$(OBJ_EXT)
353353
354354
obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
355355

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ keywords.h The keyword numbers
6161
l1_char_class_tab.h 256 word bit table of character classes (for handy.h)
6262
locale.c locale-specific utility functions
6363
locale_table.h header for locale.c
64+
long_names.c for use when NO_SHORT_NAMES is #defined
6465
make_ext.pl Used by Makefile to execute extension Makefiles
6566
make_patchnum.pl Script to generate git_version.h and lib/Config_git.pl files for all OS'es
6667
makedef.pl Create symbol export lists for linking

Makefile.SH

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,8 @@ h = \
550550
551551
c_base = \
552552
av.c builtin.c caretx.c class.c deb.c doio.c doop.c dquote.c dump.c \
553-
globals.c gv.c hv.c keywords.c locale.c mathoms.c mg.c mro_core.c \
554-
numeric.c op.c pad.c peep.c perl.c perlio.c perly.c \
553+
globals.c gv.c hv.c keywords.c locale.c long_names.c mathoms.c mg.c \
554+
mro_core.c numeric.c op.c pad.c peep.c perl.c perlio.c perly.c \
555555
pp.c pp_ctl.c pp_hot.c pp_pack.c pp_sort.c pp_sys.c \
556556
reentr.c regcomp.c regcomp_debug.c regcomp_invlist.c regcomp_study.c \
557557
regcomp_trie.c regexec.c run.c scope.c sv.c taint.c time64.c toke.c \

embed.h

Lines changed: 243 additions & 237 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)