diff --git a/Makefile b/Makefile index c49192ae..619dacbe 100644 --- a/Makefile +++ b/Makefile @@ -40,10 +40,12 @@ # o/dbg/examples/crashreport.com # less examples/crashreport.c # -# # extremely tiny binaries +# # extremely tiny binaries (scout's honor escape hatch) +# # please pay the $1k for commercial license if you can # make -j8 -O MODE=tiny \ -# LDFLAGS=-s \ -# CPPFLAGS=-DSUPPORT_VECTOR=0b00000001 \ +# LDFLAGS+=-s \ +# CPPFLAGS+=-DIM_FEELING_NAUGHTY \ +# CPPFLAGS+=-DSUPPORT_VECTOR=0b00000001 \ # o/tiny/examples/hello4.elf # ls -hal o/tiny/examples/hello4.elf # o/tiny/examples/hello4.elf @@ -192,6 +194,7 @@ include test/dsp/core/test.mk include test/dsp/scale/test.mk include test/dsp/tty/test.mk include test/dsp/test.mk +#-φ-examples/package/new.sh OBJS = $(foreach x,$(PKGS),$($(x)_OBJS)) SRCS = $(foreach x,$(PKGS),$($(x)_SRCS)) diff --git a/README.md b/README.md index 0c304d87..9b69cb0d 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,26 @@ without the costs and restrictions cross-platform distribution entails. That makes Cosmopolitan an excellent fit for writing small CLI programs that do things like heavyweight numerical computations as a subprocess. +## Getting Started + +Just clone the repository and put your own folder in it. Please choose a +name that's based on a .com or .org domain name registration you control +which is scout's honor but might change to require TXT records in future + +We provide a script that makes it easy to start a new package: + + examples/package/new.sh com/github/user/project + emacs com/github/user/project/program.c + make o//com/github/user/project/program.c + o//com/github/user/project/program.c + +Please note GNU make is awesome. Little known fact: make is a functional +programming language. We've improve upon it too see tool/build/package.c +which performs strict dependency checking, to correct Google's published +mistakes c. 2006 which was when they switched from using a GNU Make repo +in favor of an inhouse derivative called Blaze which does strictness too +thereby allowing the repository to grow gracefully with any requirements + ## Licensing Cosmopolitan is Free Software licensed under the GPLv2. The build config @@ -41,6 +61,24 @@ you want your license to last 5 years, send $10,000 to the author above who is Justine Tunney . This README will be updated, if pricing and other details should change. Reach out for more details. +## Integrated Development Environment + +Your Cosmopolitan IDE is based on Emacs. When used alongside `make tags` +it can automate certain toilsome problems such as adding an include line +by typing `C-c C-h` with the cursor over a symbol. Please install these: + + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" + sudo apt install gdb ragel ctags clang-format-10 # <-recommended + git clone git@github.com:jart/cosmopolitan.git && cd cosmopolitan + tool/scripts/install-emacs.sh # recommended over apt + tool/scripts/configure-emacs.sh # adds load statements + make tags # index all the symbol + emacs # for power and glory! + +See [tool/emacs/cosmo-stuff.el] for further details. Noting what enables +the to work so well and fast is our break with tradition by using rooted +quoted include statements while vendoring the transitive closure of deps + ## Contributing We'd love to accept your patches! Before we can take them, we have to @@ -49,3 +87,162 @@ jump through one legal hurdle. Please write an email to Justine Tunney any changes you contribute to Cosmopolitan. We need to do that in order to dual license Cosmopolitan. Otherwise we can't tax corporations that don't want to share their code with the community. + +## Volunteering + +We also need volunteers who can help us further stabilize System Five's +application binary interface. See our ABI scripts [libc/sysv/consts.sh] +and [libc/sysv/syscalls.sh]. Magic numbers are usually stabler than API +interfaces cf. NPM but we should ideally have fewer of them, similar to +how SI has sought to have fewer defining physics constants. + +## Specimen + +Cosmopolitan encodes binaries respecting the intersection of reasonable +platform requirements. That's easy to accomplish w/ binary isomorphisms +evidenced below by the RADIX256 disassembly below for [examples/life.c] +which ld is configured to overlay pe/elf/macho/bourne/bootloader in 12k + +Please send feedback and concerns to since we would +love to do an even better job. Please also report GPL abuse the address +above as well. We believe this binary structure is novel, and therefore +easily recognizable. So if some goofball isn't bundling the source code +please let us know so we can reach out and ask they consider a license. + + make -j10 -O MODE=tiny CPPFLAGS=-DIM_FEELING_NAUGHTY + o/tiny/tool/viz/bing.com /dev/null◙elif exec 7<> “$o“; then◙printf ‘╲ + 177ELF╲2╲1╲1╲011╲0╲0╲0╲0╲0╲0╲0╲0╲2╲0╲076╲0╲1╲0╲0╲0╲134╲022╲100╲0 + 00╲000╲000╲000╲000╲150╲012╲000╲000╲000╲000╲000╲000╲000╲000╲000╲0 + 00╲000╲000╲000╲000╲0╲0╲0╲0╲100╲0╲070╲0╲004╲000╲0╲0╲000╲000╲000╲0 + 00‘ >&7◙exec 7<&-◙fi◙exec “$@“◙R=$⁇◙if [ $R -eq 126 ] && [ “$(un + ame -m)“ != x86_64 ]; then◙if Q=“$(command -v qemu-x86_64)“; the + n◙exec “$Q“ “$@“◙else◙echo error: need qemu-x86_64 >&2◙fi◙fi◙exi + t $R◙αcτμαlly pδrταblε εxεcμταblε♪◙ error:  ♪◙ cpuid oldskool ds + knfo e820 nomem nolong hello◙ ♀  Cf☼▼D  8 ╕D      f☼▼D           + λλ   Ü☼ λλ   Æ☼ λλ   Ü╧ λλ   Æ╧ λλ   ¢» λλ   ô» ☻░¡←  ☺ ■OQΣ≡♦   +   ►  0►  @► ►♣  =☻░¡+☼à↑♪  j ¥▓@☼ └âα■☼“└fΩW@  ÉÉÉÉUëσΦ§♪Φ↓ ┐• î + ♠▬2ú↑2Φ(☺┐EDΦÑ Φ╨♀Φ→☻Uëσ╣♦ ╛ 0¼ê┬¼ê╞à╥t♀QVë╫╛€DΦ○ ^YâΘ☺uσ]├Uëσë· + à╥t↑RV1╔▒♥☺╩¼^♀ÇεZ¼εâ┬☺âΘ☺y÷]├UëσΦ↕ Φ  Uëσ┐ 0╛♦ ΦÇ ΦÉ☺Uëσï╖☻0à÷u + ♦ï6 01└PV╕lDPVWV╕dDP_àλt♠^Φ♦ δ⌡]├UëσWVΦ♂ ^_à÷t♥Φ↨ ]├Uëσë■─>▬2Φ╕  + î♠▬2ú↑2]├UëσSë√ç▐¼ç▐ä└t↑ë╟VP╕  δ◘XΦ.   δ♦XΦ( ^δ▀[]├ë±ë■1╥¼ê┬¼ê╞à + └t◄â┬♣┤@∞ α≤Ét∙âΘ☺uσ├PQRë≥â┬♣┤ ∞ αu♦≤Éδ≈ë°ë≥εZYX├UëσS┤╕░ Ä└ë°<♥t + ☻0φ1λj X═►┤☺░ ╡ ▒ ═►┤►░♥╖ │ ═►1└[]├Uëσâ∞►ûë∙ëμëτ¬ë╧j☺Zδ♫V¼ä└u√ë≥ + ^)≥UëσSë╤ë·ÇΓ ÇμÇÇ┬áÇ╓☼╖ │á9·t)w↕¼<◙t↕<♪t↕¬░•¬âΘ☺uΦë°[]├☺▀δ≥ë°R1 + ╥≈√)╫ZδμPQRVë▐P╕  δ◘XΦ♫   δ♦XΦ◘ ë╟^ZYXδ╞≈╥ë∙Çß ÇσÇç╧)±Q)∙ë■☺╬╕   + ▲•≤ñX├Uëσ╕ S1█═§r→ü√MPu¶╕☺S1█═§1█1╔╕•S│☺▒♥═§Φ╢◙UëσΦ↔ Φy☺┐ ►╛  Φz +  r○Φ╟ Φ∞ Φ‘☻╕àDΦ♀■Uëσ£X% puMf£fXfë┴f╗    f1╪fPf¥f£fXf9┴t:f!╪fPf¥ + f┐   Çfë°fG☼óf9°|∟fë°☼óf┐    f!·f9·u○1└]├╕uDδ◙╕ÉDδ♣╕oDδ Φú²Uëσfh + PAMSS┴∩♦Ä╟f1λf1█f╕ Φ  f╣↑   fïVⁿ═§r&f;Fⁿu à╔t♫â∙§r♠÷E¶☺u♥â╟↑fà█t + ♦9≈r╦ë°[╔├∙δ·Uëσ·☼☺▬¿D☼ └♀☺☼“└δ ╣  Äß$■☼“└fΩrH    √]├UëσSf╛ @  f + ╗  ► f╣↑   f┴ß○fâ╩ⁿfâ┬♦f9╤t♫dgfï♦▬dgfë♦‼δΘgfì∟‼┐  ╕ @Ä└ï♫@2ï▬B2à + λt+ë°S1█ΦS°[)╟Që┴┴ß○1÷&fï♦dgfë♥fâ├♦â╞♦âΘ♦uδYδ╤[]├·▲1└Ä└HÄ╪┐ ♣╛►♣ + &è♣Pè♦P&╞♣ ╞♦λ&Ç=λXê♦X&ê♣▼u@╕☺ Φ, ░¡μdΦ% ░╨μdΦ% Σ`PΦ↑ ░╤μdΦ◄ X♀☻ + μ`Φ○ ░«μdΦ☻ δúΣd¿☻u·├Σd¿☺t·├√├Uëσ▲╕ lÄ╪f╟♠ 0♥α♠ f╟♠  ♥╨♠ f╟♠ ►♥└ + ♠ ╣ ☺f╕♥   1÷fë♦f♣ ►  â╞◘âΘ☺u∩▼f╟♠ 2 └♠ f╕ ≡♠ ☼“╪]├·☼☺▲02Φóλ☼ αf + ♪á☻  ☼“αf╣Ç  └☼2f♪☺☺  ☼0☼☺▬¿D☼ └f♪♥  Çfâα√☼“└Ω≥I( ╕0   Ä╪ÄαÄΦ1╥δ +  HâΣ≡1φ1λΦ]•  ┐ ►  Φ{•  ┐ ►  ╛ ≡♠ ║ 2  Φ≡♣  ┐ùD  ï4% 0  Φ╠√λλ┐ 0 +   ╛♦   Φτ√λλΘΓ•  Hì§█•  Φλ•  Θ╤•  É☼▼D  ☺   ♣             @      +   ►                      ►      ☺   ♠             @       ►      +  ►               ►      Qσtd♠                                    +         ►       ♦   ♦   P♂      P♂@     P♂►     ↑       ↑        + ◘       É☼▼Ç    ◘   ♦   ☺   OpenBSD     É☼▼Ç    PE  då☻ k↕d╲     +     ≡ #☻♂☻♫☼            ╞¶        @      ►   ►  ♠       ♠        +  @   ►      ♥  ☺  ►       ♥       ◘      ►          ►            + ä←  (                                                            +                         ►   @                           .text    +  ►   ►   ►   ►              `  p.data            ►               +     └  └É☼▼Ç    ╧·φ■•  ☺♥   ☻   ♣   ÿ☻  ☺       ↓   H   __PAGEZE + RO                                                      ↓   ÿ    + __TEXT            @                             •   ♣   ☺        + __text          __TEXT           ►@      ►       ►  ♀            +  ♦              ↓   Φ   __DATA            @                      +  ►      •   ♥   ☻       __data          __DATA            @      +  ►          ♀                           __bss           __DATA   +          0@      ►          ♀           ☺               ←   ↑    + B)→☺&¿◘ºB)→☺&¿◘º♣   ╕   ♦   *             @                      +                                                                  +                                 S↕@                              +         Éf.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä +      f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f☼▼ä      + ZAR╕    Hà└t◙Hà└t♣Θ»♦  Θ@☻  UHë╤HëσAWIë≈AVA╛  @ AUIë²ATA╝  ► SHë + √Hâ∞↑Hâ{◘ ☼ä╕   ïS►Hë╪Hâ├↑λ╩t○Hâ{◘ uδδ♥Hë├L9#L☼C#Iü─λ☼  IüΣ ≡λλH + ïC◘H♥♥H% ≡λλI9─snIïU◘Hà╥t↓Aâ}►☺u♠Iâ┼↑δΩIïE H☺╨L9αrεIïE L9αw◄H☺╨L + 9αv○Lìáλ☼  δ½Lë·Lë≈╛♥   HëM╚Φ6   LëΓHïM╚Iü╞ ►  Hâ╩♥Iü─ ►  Hë►δÇH + â├↑Θ=λλλHâ─↑[A╲A]A^A_]├I╣ ≡λλλλ♥ Ië╚╣‘   Hë°λ╬H╙Φ%λ☺  â■λu♣Hì♦┬├ + Hì¶┬Hâ: u‼Iï H- ►  Ië Hâ╚♥Hë☻Hï☻âΘ○L!╚Hë┬δ╛U╣ 2  ║ ≡♠ ╛♥   HëσSH + ë√PΦÅλλλHâ ■☼☺;Z[]├1÷ë≡Hk└↑Hâ|•◘ t♦λ╞δεA╕☺   HìW↑A9≡r☺├UHëσATSLï + ◙HïZ◘Hë╤Dë└DïZ►DïR¶Aë─λ╚L;IΦt→☼►AΦLïa°HâΘ↑☼◄A↑Lëa(à└u▌δ♥DëαHk└↑A + λ└Hâ┬↑H☺°Lë◘HëX◘DëX►DëP¶A9≡rí[A╲]├1└├UëσSç█[fÉ╠·⌠δ²Uëσâ∞◘U^ì~°j◘ + Y1└≤¬·☼☺^°☼♂δ≈Uëσ]├╞♣ª↔  ◘δ►HàλH☼Eτt•╞♣ö↔   Lc$$Lìl$◘NìtΣ↑╕“↕@ ┐ + ► @ ╣P @ H)∙┴Θ♥≤H½1└â╔λLë≈≥H»IëλΘ╧   UHëσ┐ 0@ ╛°←@ ╣00@ HìA►Hë☺╟ + A◘ ♥  SV÷•◘u<÷• u!÷•♦u◄Iâ⁇ t!j j☺╛ⁿ←@ δ*j“j♦╛☻∟@ δ▼j0j ╛∙←@ δ¶j* + j►╛λ←@ δ○jEj◘╛♦∟@ ╣q↓@ XH½XH☺╚H½W┐↑0@ Iâ╔λ╗(0@ H9▀s51╔1╥¼Ië└Aâα⌂ + I╙αâ┴•L○┬ä└xδ¿@t○Lë╚H╙αH○┬Hë╨Hâ⁇ H☼E•H½δ╞_^[╔├╕*   ├HâΣ≡1φ╗  @ Φ + !λλλâ♪┴▼  ☺╕◘ @ ╣◘ @ H9┴t♀PQλ►YXHâ└◘δ∩ÉLëτLëεLë≥Φ╣λλλë╟Φ    UHëσ + ATAëⁿ1λPΦr   DëτΦö♠  1÷1╥UHëσAW╣00@ Ië╧Iï•IïO◘Hà╔t∟HâΘ↑Hë¶◘Hët◘◘ + Hë|◘►IëO◘1└A_]├╣    Hà╔t≥PWVj!_j►^λ╤^_YHà└t▀I╟└ ♥  Ië•Jë♀ Lë┴δ┤U + HëσAVAUATHï5α←  Ië■Ië⌠j YH¡HÆH¡HùH¡Hà└t↑Mà÷δ♣L9≥u♫VQQλ╨YY^1└HëF° + âΘ☺u╘H¡Hà└t◄Mà÷t○PLëτΦfδ┐λ^δ╢A╲Mà÷u←╕► @ ╣► @ HâΦ◘H9╚|◘PQλ►YXδ∩A + ]A^]├╠U╣ ◘  1└HëσAWAVAUATSHü∞Hα  Hëà└▼λλHëà╚▼λλλ§C♂  Hâ─ à└uGHâ∞ + H╟┴⌠λλλ맓♂  Hâ─↑A╕♠   Lìì╨⌂λλj Hë┴║⌐→@ Hâ∞ λ§♪♂  XZ╣☺   λ§╨◙   + Hâ─ Hâ∞ j♦Xë♣»→  λ§╔◙  Ië─λ§╚◙  LëτHâ─ A╕ ☻  Hìì╨/λλ║λ⁇  Hì╡╤⁇λλ + Ië┼Φ╙☺  Aë─1└Hïì╨/λλH☺┴è◄ä╥t♪Ç·╲u♥╞☺/Hλ└δπA☼╖E f=λ╫w♪ëà╝▼λλ╕☺    + δ☼Hì╡╝▼λλLë∩Φ0♦  ë└Hìì╨⌂λλE1└1█H☺└Ië╦LìU╬A╛²⌂  IìT♣ Hì╡╝▼λλâ╜╝▼λ + λ ☼äÅ   Iλ└Iü°λ☺  w↕L9╤Hë╪H☼B┴Jëä┼╚▼λλDïì╝▼λλIc┴Aâ∙⌂v◘Dë╧ΦÉ♥  L9 + ╤s♀Hλ┴êAλH┴Φ◘u∩☼╖☻f=λ╫w♪ëà╝▼λλ╕☺   δ◘Hë╫Φö♥  ë└H☺└H☺┬Eà╔u¼Hë╚L)╪ + H=²⌂  I☼G╞╞ä♣╨⌂λλ ΘdλλλL9╤s♠╞☺ Hλ┴L)┘╕■⌂  Lì╡╨▼λλHü∙■⌂  Lì╜└▼λλH + ☼G╚Iü°λ☺  ╕λ☺  L☼G└Hâ∞ ╞ä♪╨⌂λλ LëΘLì¡╨/λλJ╟ä┼╨▼λλ    λ§↔○  Θtⁿλλ + Hë·Hï⁇☼╖•f=λ╫w◙ëB↑╕☺   δ○Hìr↑Φ▀☻  ë└H☺└H☺☻├Hë·Hc╞ë≈LïB►â■⌂v♣Φì☻  +  HïJ◘I9╚v►Hìq☺Hër◘ê☺H┴Φ◘uτ├UHì♦▬Ië╙Më┬HëσAWI┐ &  ☺   AVAUIë⌡ATS1 + █Hâ∞8Hë}░Hì}░HëM¿Hëu╕HëE└Φbλλλâ}╚ t↔ïE╚à└t▬â° w╲I☼ú╟sVHì}░ΦAλλλδ + π1÷Hì}░Φ_λλλMà█t↨HïE╕Iλ╦L)ΦL9╪I☼G├A╞D♣  Mà╥☼äf☺  Iλ╩HïE¿I9┌L☼G╙J + ╟♦╨    ΘK☺  Hλ├L9╙s§HïE╕H;E└r☻1└HïU¿HëD┌°E1÷ïu╚à÷☼ä►☺  Eä÷u¶â■ w + ☼I☼ú≈☼âσ   Θ≈   â■“t○â■╲☼à╥   E1Σâ}╚╲u♫Hì}░Iλ─Φì■λλδ∞E1╔â}╚“u♫Hì + }░Φy■λλIλ┴δ∞LëαMà╔u↓Iλ╠IâⁿλtÅ╛╲   Hì}░ΦÇ■λλδτHâ°☺v∟╛╲   Hì}░HëEá + Φf■λλHïEáHâΦ☻δ▐AÇΣ☺t↨╛“   Hì}░ΦH■λλIλ╔☼ä@λλλAÇ■☺A╛♥   Iâ┘ Mìa☺M9 + ⌠r¶╛“   Hì}░Iâ╞♥Φ▬■λλδτ1╥╣♥   Lë╚H≈±Hà╥A☼ö╞Θⁿ■λλHì}░Φ≥²λλHì}░Φ╛² + λλΘσ■λλ1÷Hì}░Φ┘²λλΘG■λλHâ─8ë╪[A╲A]A^A_]├╠Hì♣╪↓  ├☼┐└à└x←Ië╩☼♣H=☺ + ≡λλs☺├≈╪ë♣║↓  jλX∙├ï♣⌂▬  δφH┴Φ0δ•H┴Φ ☼╖└f=λ☼sσIë╩☼♣r╙├Aë├┴Φ►%λ☼  +  A┴δ∟A┴π↑D○╪δ┌QRëλ1└âλ⌂v“☼╜╧║┐→@ ïLJ≥ë·┴∩♠ÇΓ⁇♀Ç◘╨H┴α◘■╔u∞◘ΦH○°ZY + ├U1└HëσWVSQRë┬ë├λ└☼╖¶Wë╤füß ⁿfü∙ ▄tΦfü∙ ╪t♦ë▬δ,☼╖♦Gë┴füß ⁿfü∙ ▄t + ♂╟♠²λ  â╚λδ☼┴Γ◙ìä☻ $áⁿë♠ìC☻ZY[^_]├f☼▼D  Éâ♪▄↑  ♦÷♣맠 ♦t♪@☼╢╧λ§ì + ♣  δ°╠ï♣ö§  ☼♣·☼☺∟%Ü→@ ⌠δ²        f☼▼D  Énodll◙ KernelBase.dll ☺ + └☺└☺└☺└☻α☻α☻α☻α☻α♥≡♥≡♥≡♥≡♥≡♦°♦°♦°♦°♦°♣ⁿ♣ⁿ♣ⁿ♣ⁿ♣ⁿ♣ⁿÉÉ☼▼D  ⁇♣ExitPr + ocess æ☺FreeEnvironmentStringsW ╜☺GetCommandLineW ‼☻GetEnvironme + ntStringsW  ╘☻GetStdHandle  ╫♣SetDefaultDllDirectories  ▼•WriteF + ile ░←          ░→  ►                       ☼▼@ °→      ♠←       + ←      2←      L←      ╲←      x←              É☼▼Ç    É╬ ☺&τ☺╬ +  ☺☺⌂╬ üÇÇ►f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ + ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä    +   f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f. + ☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä  +     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä      + f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ + ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä    +   f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f. + ☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä  +     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä      + f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ + ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä    +   f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f. + ☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä  +     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä      + f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     f.☼▼ä     ☼▼@  +   @             °→      ♠←       ←      2←      L←      ╲←       + x←                                                               + +See also `build/dump -xd o/tiny/examples/life.com.dbg | less` assembly +and our linker script [ape/ape.lds] which glues the binaries together. diff --git a/ape/ape.S b/ape/ape.S index 3a27df99..5d36873e 100644 --- a/ape/ape.S +++ b/ape/ape.S @@ -45,11 +45,10 @@ #include "libc/nexgen32e/vidya.h" #include "libc/nt/pedef.h" #include "libc/sysv/consts/prot.h" -.yoink __FILE__ -.yoink "NOTICE" -.section .head,"ax",@progbits -/ Common Sections. + .source "NOTICE" + .source "ape/ape.S" + .source "ape/ape.lds" .section .text,"ax",@progbits .align __SIZEOF_POINTER__ .previous @@ -69,6 +68,7 @@ cstr: .endobj cstr,globl,hidden # ←for gdb readibility .section .sort.rodata.real.str1.1,"aMS",@progbits rlstr: .endobj rlstr,globl,hidden # ←for gdb readibility .previous + .section .head,"ax",@progbits /* ████████ ████████ ███████████ ██░░░░▒▒██ ██░░░░▒▒██ ████░░░░░░░░░▒▒████ @@ -1932,4 +1932,4 @@ __data_start: .hidden __piro_start .end - \ No newline at end of file + diff --git a/ape/ape.lds b/ape/ape.lds index 27bf5718..1d4d0438 100644 --- a/ape/ape.lds +++ b/ape/ape.lds @@ -105,7 +105,7 @@ strip input.com.dbg # remove all symbols strip -S input.com.dbg # remove debug info only make CPPFLAGS=-DNDEBUG # remove asserts (prod) - make CPPFLAGS=-DIM_FEELING_NAUGHTY # remove legal notices + make CPPFLAGS=-DIM_FEELING_NAUGHTY # remove legal embeddings The Makefile build is also configured to always produce a .map file when building each program, which provides further details. @@ -333,9 +333,11 @@ SECTIONS { /*BEGIN: Read only data that needn't be mapped after initialization */ /* Legal Notices */ +#ifndef IM_FEELING_NAUGHTY KEEP(*(.commentprologue)) KEEP(*(.comment)) KEEP(*(.commentepilogue)) +#endif /* Windows DLL Import Directory */ KEEP(*(.idata.ro)); @@ -563,7 +565,7 @@ ZIPCONST(v_zip_commentsize, _edata - __zip_end - kZipCdirHdrMinSize); X = (X + (Y >> 010) & 0xFF) * PHI; \ X = (X + (Y >> 020) & 0xFF) * PHI; \ X = (X + (Y >> 030) & 0xFF) * PHI -#define BOOP(X) \ +#define CHURN(X) \ XORSHIFT(uuid1_, X); \ KMH(uuid1_, X); \ XORSHIFT(uuid2_, X); \ @@ -572,68 +574,68 @@ ZIPCONST(v_zip_commentsize, _edata - __zip_end - kZipCdirHdrMinSize); HIDDEN(uuid1_ = 88172645463325252); HIDDEN(uuid2_ = 88172645463325252); -BOOP(.Lape.bss.align); -BOOP(.Lape.bss.filesz); -BOOP(.Lape.bss.memsz); -BOOP(.Lape.bss.offset); -BOOP(.Lape.bss.paddr); -BOOP(.Lape.data.align); -BOOP(.Lape.data.filesz); -BOOP(.Lape.data.memsz); -BOOP(.Lape.data.offset); -BOOP(.Lape.data.paddr); -BOOP(.Lape.data.rva); -BOOP(.Lape.data.vaddr); -BOOP(.Lape.elf.entry); -BOOP(.Lape.elf.phnum); -BOOP(.Lape.elf.phoff); -BOOP(.Lape.elf.shnum); -BOOP(.Lape.elf.shoff); -BOOP(.Lape.elf.shstrndx); -BOOP(.Lape.macho.end); -BOOP(.Lape.note); -BOOP(.Lape.note.align); -BOOP(.Lape.note.end); -BOOP(.Lape.note.filesz); -BOOP(.Lape.note.memsz); -BOOP(.Lape.note.offset); -BOOP(.Lape.note.paddr); -BOOP(.Lape.note.vaddr); -BOOP(.Lape.pe.offset); -BOOP(.Lape.pe.optsz); -BOOP(.Lape.pe.sections); -BOOP(.Lape.pe.sections_end); -BOOP(.Lape.pe.shnum); -BOOP(.Lape.phdrs.end); -BOOP(.Lape.ram.align); -BOOP(.Lape.ram.filesz); -BOOP(.Lape.ram.memsz); -BOOP(.Lape.ram.offset); -BOOP(.Lape.ram.paddr); -BOOP(.Lape.ram.rva); -BOOP(.Lape.ram.vaddr); -BOOP(.Lape.rom.align); -BOOP(.Lape.rom.filesz); -BOOP(.Lape.rom.memsz); -BOOP(.Lape.rom.offset); -BOOP(.Lape.rom.paddr); -BOOP(.Lape.rom.rva); -BOOP(.Lape.rom.vaddr); -BOOP(.Lape.text.align); -BOOP(.Lape.text.filesz); -BOOP(.Lape.text.memsz); -BOOP(.Lape.text.offset); -BOOP(.Lape.text.paddr); -BOOP(.Lape.text.rva); -BOOP(.Lape.text.vaddr); -BOOP(ADDR(.bss)); -BOOP(WinMain); -BOOP(_start); -BOOP(ape.macho); -BOOP(ape.mz); -BOOP(ape.pe); -BOOP(ape.phdrs); -BOOP(v_ape_realsectors); +CHURN(.Lape.bss.align); +CHURN(.Lape.bss.filesz); +CHURN(.Lape.bss.memsz); +CHURN(.Lape.bss.offset); +CHURN(.Lape.bss.paddr); +CHURN(.Lape.data.align); +CHURN(.Lape.data.filesz); +CHURN(.Lape.data.memsz); +CHURN(.Lape.data.offset); +CHURN(.Lape.data.paddr); +CHURN(.Lape.data.rva); +CHURN(.Lape.data.vaddr); +CHURN(.Lape.elf.entry); +CHURN(.Lape.elf.phnum); +CHURN(.Lape.elf.phoff); +CHURN(.Lape.elf.shnum); +CHURN(.Lape.elf.shoff); +CHURN(.Lape.elf.shstrndx); +CHURN(.Lape.macho.end); +CHURN(.Lape.note); +CHURN(.Lape.note.align); +CHURN(.Lape.note.end); +CHURN(.Lape.note.filesz); +CHURN(.Lape.note.memsz); +CHURN(.Lape.note.offset); +CHURN(.Lape.note.paddr); +CHURN(.Lape.note.vaddr); +CHURN(.Lape.pe.offset); +CHURN(.Lape.pe.optsz); +CHURN(.Lape.pe.sections); +CHURN(.Lape.pe.sections_end); +CHURN(.Lape.pe.shnum); +CHURN(.Lape.phdrs.end); +CHURN(.Lape.ram.align); +CHURN(.Lape.ram.filesz); +CHURN(.Lape.ram.memsz); +CHURN(.Lape.ram.offset); +CHURN(.Lape.ram.paddr); +CHURN(.Lape.ram.rva); +CHURN(.Lape.ram.vaddr); +CHURN(.Lape.rom.align); +CHURN(.Lape.rom.filesz); +CHURN(.Lape.rom.memsz); +CHURN(.Lape.rom.offset); +CHURN(.Lape.rom.paddr); +CHURN(.Lape.rom.rva); +CHURN(.Lape.rom.vaddr); +CHURN(.Lape.text.align); +CHURN(.Lape.text.filesz); +CHURN(.Lape.text.memsz); +CHURN(.Lape.text.offset); +CHURN(.Lape.text.paddr); +CHURN(.Lape.text.rva); +CHURN(.Lape.text.vaddr); +CHURN(ADDR(.bss)); +CHURN(WinMain); +CHURN(_start); +CHURN(ape.macho); +CHURN(ape.mz); +CHURN(ape.pe); +CHURN(ape.phdrs); +CHURN(v_ape_realsectors); ASSERT(ape.mz == IMAGE_BASE_VIRTUAL, "linker panic"); ASSERT((DEFINED(__init_bss_end) ? __init_bss_end : 0) % __SIZEOF_POINTER__ == 0, diff --git a/ape/ape.mk b/ape/ape.mk index 8f18dc80..997b1b88 100644 --- a/ape/ape.mk +++ b/ape/ape.mk @@ -15,38 +15,37 @@ PKGS += APE -DEFAULT_COPTS += -mno-red-zone -DEFAULT_LDFLAGS += -z max-page-size=0x1000 - -APELINK = ACTION=LINK.ape $(LINK) $(LINKARGS) $(OUTPUT_OPTION) && $(STRIP) -X $@ && $(GZ) $(ZFLAGS) -f $@.map - APE = $(APE_DEPS) \ $(APE_OBJS) \ o/$(MODE)/ape/ape.lds -APE_FILES := \ - $(wildcard ape/*.*) +APELINK = \ + ACTION=LINK.ape \ + $(LINK) \ + $(LINKARGS) \ + $(OUTPUT_OPTION) && \ + $(STRIP) \ + -X $@ && \ + $(GZ) \ + $(ZFLAGS) \ + -f $@.map -APE_HDRS = \ - $(filter %.h,$(APE_FILES)) +DEFAULT_COPTS += -mno-red-zone +DEFAULT_LDFLAGS += -z max-page-size=0x1000 -APE_SRCS = \ - $(filter %.S,$(APE_FILES)) - -APE_OBJS = \ - $(APE_SRCS:%=o/$(MODE)/%.zip.o) \ - $(APE_SRCS:%.S=o/$(MODE)/%.o) - -APE_DEPS = \ - $(APE_LIB) - -APE_CHECKS = \ - $(APE_HDRS:%=o/%.ok) +APE_FILES := $(wildcard ape/*.*) +APE_HDRS = $(filter %.h,$(APE_FILES)) +APE_SRCS = $(filter %.S,$(APE_FILES)) +APE_OBJS = $(APE_SRCS:%.S=o/$(MODE)/%.o) +APE_DEPS = $(APE_LIB) +APE_CHECKS = $(APE_HDRS:%=o/%.ok) o/%.com: o/%.com.dbg @ACTION=OBJCOPY.ape TARGET=$@ build/do $(OBJCOPY) -SO binary $< $@ -o/ape/idata.inc: ape/idata.h ape/relocations.h +o/ape/idata.inc: \ + ape/idata.h \ + ape/relocations.h $(APE_OBJS): $(BUILD_FILES) \ ape/ape.mk diff --git a/ape/lib/apelib.mk b/ape/lib/apelib.mk index 1b885dfc..85f4ddf6 100644 --- a/ape/lib/apelib.mk +++ b/ape/lib/apelib.mk @@ -19,6 +19,8 @@ APE_LIB_A_OBJS = \ $(APE_LIB_A_SRCS_S:%.S=o/$(MODE)/%.o) \ $(APE_LIB_A_SRCS_C:%.c=o/$(MODE)/%.o) \ $(APE_LIB_A_SRCS:%=o/$(MODE)/%.zip.o) \ + o/$(MODE)/ape/ape.lds.zip.o \ + o/$(MODE)/ape/ape.S.zip.o \ o/$(MODE)/NOTICE.zip.o APE_LIB_A_CHECKS = $(APE_LIB_A_HDRS:%=o/$(MODE)/%.ok) diff --git a/ape/lib/bootdr.S b/ape/lib/bootdr.S index eecd59ae..9b66ce8b 100644 --- a/ape/lib/bootdr.S +++ b/ape/lib/bootdr.S @@ -20,7 +20,7 @@ #include "ape/macros.h" #include "ape/notice.inc" .section .real,"ax",@progbits -.yoink __FILE__ +.source __FILE__ .code16 / Resets personal computer. diff --git a/ape/lib/e820map.S b/ape/lib/e820map.S index c3990965..be210e01 100644 --- a/ape/lib/e820map.S +++ b/ape/lib/e820map.S @@ -22,7 +22,7 @@ #include "ape/macros.h" #include "ape/notice.inc" .section .real,"ax",@progbits -.yoink __FILE__ +.source __FILE__ .code16 .globl e820map diff --git a/ape/lib/g_pml4t.S b/ape/lib/g_pml4t.S index 7c9d8e83..566b7bc8 100644 --- a/ape/lib/g_pml4t.S +++ b/ape/lib/g_pml4t.S @@ -22,7 +22,7 @@ #include "ape/macros.h" #include "ape/notice.inc" .section .real,"ax",@progbits -.yoink __FILE__ +.source __FILE__ .code16 .globl g_pml4t diff --git a/ape/lib/g_ptsp.S b/ape/lib/g_ptsp.S index b7cc8db1..b3883117 100644 --- a/ape/lib/g_ptsp.S +++ b/ape/lib/g_ptsp.S @@ -22,7 +22,7 @@ #include "ape/macros.h" #include "ape/notice.inc" .section .real,"ax",@progbits -.yoink __FILE__ +.source __FILE__ .code16 .globl g_ptsp diff --git a/ape/lib/kbiosdataarea.S b/ape/lib/kbiosdataarea.S index 4088616e..6188e8c2 100644 --- a/ape/lib/kbiosdataarea.S +++ b/ape/lib/kbiosdataarea.S @@ -22,7 +22,7 @@ #include "ape/macros.h" #include "ape/notice.inc" .section .real,"ax",@progbits -.yoink __FILE__ +.source __FILE__ .code16 .globl kBiosDataArea diff --git a/build/definitions.mk b/build/definitions.mk index 3e6f875d..251b1582 100644 --- a/build/definitions.mk +++ b/build/definitions.mk @@ -51,7 +51,7 @@ CP ?= /bin/cp -f RM ?= /bin/rm -f SED ?= /bin/sed MKDIR ?= /bin/mkdir -p -TAGS ?= ctags +TAGS ?= /usr/bin/ctags # emacs source builds or something breaks it ARFLAGS = rcsD TAGSFLAGS ?= -e -a --if0=no --langmap=c:.c.h.i --line-directives=yes SILENT ?= 1 @@ -74,6 +74,7 @@ NM = o/third_party/gcc/bin/x86_64-linux-musl-nm GCC = o/third_party/gcc/bin/x86_64-linux-musl-gcc STRIP = o/third_party/gcc/bin/x86_64-linux-musl-strip OBJCOPY = o/third_party/gcc/bin/x86_64-linux-musl-objcopy +OBJDUMP = o/third_party/gcc/bin/x86_64-linux-musl-objdump ADDR2LINE = o/third_party/gcc/bin/x86_64-linux-musl-addr2line COMMA := , @@ -87,6 +88,7 @@ BLAH1 := $(shell build/zipobj 2>/dev/null) BLAH2 := $(shell build/package 2>/dev/null) export ADDR2LINE +export OBJDUMP export CCNAME export CCVERSION export CP diff --git a/build/objdump b/build/objdump new file mode 100755 index 00000000..7fca2eab --- /dev/null +++ b/build/objdump @@ -0,0 +1,21 @@ +#-*-mode:sh;indent-tabs-mode:nil;tab-width:2;coding:utf-8-*-┐ +#───vi: set net ft=sh ts=2 sts=2 fenc=utf-8 :vi─────────────┘ +# +# OVERVIEW +# +# GNU Disassembly Veneer +# +# DESCRIPTION +# +# This script wraps normal objdump commands that're transparently +# passed-through. +# +# EXAMPLE +# +# build/objdump -xd o/tiny/examples/life.com.dbg + +if [ ! -d o/third_party/gcc ]; then + third_party/gcc/unbundle.sh +fi + +exec o/third_party/gcc/bin/x86_64-linux-musl-objdump "$@" diff --git a/dsp/core/mulaw.S b/dsp/core/mulaw.S index f82d33a4..e396a68f 100644 --- a/dsp/core/mulaw.S +++ b/dsp/core/mulaw.S @@ -61,4 +61,4 @@ mulaw: .leafprologue mov %edx,%eax jmp 3b .endfn mulaw,globl - .yoink __FILE__ + .source __FILE__ diff --git a/dsp/core/sad16x8n.S b/dsp/core/sad16x8n.S index d36a0b0e..7d21d59b 100644 --- a/dsp/core/sad16x8n.S +++ b/dsp/core/sad16x8n.S @@ -38,4 +38,4 @@ sad16x8n: jnz 0b 1: .leafepilogue .endfn sad16x8n,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/dsp/mpeg/clamp4int256-core.S b/dsp/mpeg/clamp4int256-core.S index a4a8753d..4da4cc4d 100644 --- a/dsp/mpeg/clamp4int256-core.S +++ b/dsp/mpeg/clamp4int256-core.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ clamp4int256$core: .leafprologue diff --git a/dsp/tty/windex-avx2.S b/dsp/tty/windex-avx2.S index 215e2528..9c3225a5 100644 --- a/dsp/tty/windex-avx2.S +++ b/dsp/tty/windex-avx2.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns index of minimum uint16 in array. / diff --git a/dsp/tty/windex-sse4.S b/dsp/tty/windex-sse4.S index b90f41be..08b657e5 100644 --- a/dsp/tty/windex-sse4.S +++ b/dsp/tty/windex-sse4.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns index of minimum positive int16 in array. / diff --git a/dsp/tty/windex.S b/dsp/tty/windex.S index 004f98f2..03353633 100644 --- a/dsp/tty/windex.S +++ b/dsp/tty/windex.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/nexgen32e/x86feature.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Dispatches to fastest windex() implementation. .initbss 300,_init_windex diff --git a/examples/package/README.md b/examples/package/README.md new file mode 100644 index 00000000..e69de29b diff --git a/examples/package/lib/lib.mk b/examples/package/lib/lib.mk new file mode 100644 index 00000000..b85244db --- /dev/null +++ b/examples/package/lib/lib.mk @@ -0,0 +1,63 @@ +#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐ +#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘ +# +# SYNOPSIS +# +# Your package static library build config +# +# DESCRIPTION +# +# Your library doesn't have a main() function and can be compromised +# of sources written in multiple languages. + +PKGS += EXAMPLES_PACKAGE_LIB + +EXAMPLES_PACKAGE_LIB_ARTIFACTS += EXAMPLES_PACKAGE_LIB_A +EXAMPLES_PACKAGE_LIB = $(EXAMPLES_PACKAGE_LIB_A_DEPS) $(EXAMPLES_PACKAGE_LIB_A) +EXAMPLES_PACKAGE_LIB_A = o/$(MODE)/examples/package/lib/lib.a +EXAMPLES_PACKAGE_LIB_A_HDRS = $(filter %.h,$(EXAMPLES_PACKAGE_LIB_A_FILES)) +EXAMPLES_PACKAGE_LIB_A_SRCS_S = $(filter %.S,$(EXAMPLES_PACKAGE_LIB_A_FILES)) +EXAMPLES_PACKAGE_LIB_A_SRCS_C = $(filter %.c,$(EXAMPLES_PACKAGE_LIB_A_FILES)) +EXAMPLES_PACKAGE_LIB_A_CHECKS = $(EXAMPLES_PACKAGE_LIB_A).pkg + +EXAMPLES_PACKAGE_LIB_A_FILES := \ + $(wildcard examples/package/lib/*) \ + $(wildcard examples/package/lib/thunks/*) + +EXAMPLES_PACKAGE_LIB_A_SRCS = \ + $(EXAMPLES_PACKAGE_LIB_A_SRCS_S) \ + $(EXAMPLES_PACKAGE_LIB_A_SRCS_C) + +EXAMPLES_PACKAGE_LIB_A_OBJS = \ + $(EXAMPLES_PACKAGE_LIB_A_SRCS_S:%.S=o/$(MODE)/%.o) \ + $(EXAMPLES_PACKAGE_LIB_A_SRCS_C:%.c=o/$(MODE)/%.o) \ + $(EXAMPLES_PACKAGE_LIB_A_SRCS:%=o/$(MODE)/%.zip.o) + +EXAMPLES_PACKAGE_LIB_A_DIRECTDEPS = \ + LIBC_STDIO \ + LIBC_STUBS + +EXAMPLES_PACKAGE_LIB_A_DEPS := \ + $(call uniq,$(foreach x,$(EXAMPLES_PACKAGE_LIB_A_DIRECTDEPS),$($(x)))) + +$(EXAMPLES_PACKAGE_LIB_A): \ + examples/package/lib/ \ + $(EXAMPLES_PACKAGE_LIB_A).pkg \ + $(EXAMPLES_PACKAGE_LIB_A_OBJS) + +$(EXAMPLES_PACKAGE_LIB_A).pkg: \ + $(EXAMPLES_PACKAGE_LIB_A_OBJS) \ + $(foreach x,$(EXAMPLES_PACKAGE_LIB_A_DIRECTDEPS),$($(x)_A).pkg) + +$(EXAMPLES_PACKAGE_LIB_A_OBJS): examples/package/lib/lib.mk + +EXAMPLES_PACKAGE_LIB_LIBS = $(foreach x,$(EXAMPLES_PACKAGE_LIB_ARTIFACTS),$($(x))) +EXAMPLES_PACKAGE_LIB_SRCS = $(foreach x,$(EXAMPLES_PACKAGE_LIB_ARTIFACTS),$($(x)_SRCS)) +EXAMPLES_PACKAGE_LIB_HDRS = $(foreach x,$(EXAMPLES_PACKAGE_LIB_ARTIFACTS),$($(x)_HDRS)) +EXAMPLES_PACKAGE_LIB_BINS = $(foreach x,$(EXAMPLES_PACKAGE_LIB_ARTIFACTS),$($(x)_BINS)) +EXAMPLES_PACKAGE_LIB_CHECKS = $(foreach x,$(EXAMPLES_PACKAGE_LIB_ARTIFACTS),$($(x)_CHECKS)) +EXAMPLES_PACKAGE_LIB_OBJS = $(foreach x,$(EXAMPLES_PACKAGE_LIB_ARTIFACTS),$($(x)_OBJS)) +EXAMPLES_PACKAGE_LIB_TESTS = $(foreach x,$(EXAMPLES_PACKAGE_LIB_ARTIFACTS),$($(x)_TESTS)) + +.PHONY: o/$(MODE)/examples/package/lib +o/$(MODE)/examples/package/lib: $(EXAMPLES_PACKAGE_LIB_CHECKS) diff --git a/examples/package/lib/myasm.S b/examples/package/lib/myasm.S new file mode 100644 index 00000000..b7552c2f --- /dev/null +++ b/examples/package/lib/myasm.S @@ -0,0 +1,6 @@ +#include "libc/macros.h" + +MyAsm: .leafprologue + call MyPrint2 + .leafepilogue + .endfn MyAsm,globl diff --git a/examples/package/lib/myprint.c b/examples/package/lib/myprint.c new file mode 100644 index 00000000..e254f365 --- /dev/null +++ b/examples/package/lib/myprint.c @@ -0,0 +1,10 @@ +#include "examples/package/lib/myprint.h" +#include "libc/stdio/stdio.h" + +void MyPrint(const char *s) { + MyAsm(s); +} + +void MyPrint2(const char *s) { + fputs(s, stdout); +} diff --git a/examples/package/lib/myprint.h b/examples/package/lib/myprint.h new file mode 100644 index 00000000..03caf310 --- /dev/null +++ b/examples/package/lib/myprint.h @@ -0,0 +1,11 @@ +#ifndef COSMOPOLITAN_EXAMPLES_PACKAGE_LIB_MYPRINT_H_ +#define COSMOPOLITAN_EXAMPLES_PACKAGE_LIB_MYPRINT_H_ +#if !(__ASSEMBLER__ + __LINKER__ + 0) +COSMOPOLITAN_C_START_ + +void MyPrint(const char *); +void MyAsm(const char *); + +COSMOPOLITAN_C_END_ +#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ +#endif /* COSMOPOLITAN_EXAMPLES_PACKAGE_LIB_MYPRINT_H_ */ diff --git a/examples/package/new.sh b/examples/package/new.sh new file mode 100755 index 00000000..75cf2d46 --- /dev/null +++ b/examples/package/new.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# SYNOPSIS +# +# Creates new package in repository. +# +# EXAMPLE +# +# examples/package/new.sh com/github/user/project + +DIR=${1:?need directory arg} +VAR=$(echo "$DIR" | tr a-z A-Z | tr / _) +BASENAME=${DIR##*/} +FILENAME="$DIR/$BASENAME" +MAKEFILE="$DIR/$BASENAME.mk" + +if [ -d "$DIR" ]; then + echo "already exists: $DIR" >&2 + exit 1 +fi + +mkdir -p "$DIR" && + cp -R examples/package/new/* "$DIR" && + find "$DIR" -type f | + xargs sed -i -e " + s/EXAMPLES_PACKAGE/$VAR/g + s/examples\/package\/package/$FILENAME/g + s/examples\/package/$DIR/g + " && + sed -i -e " + /#-φ-examples\/package\/new\.sh/i\ +include $MAKEFILE + " Makefile diff --git a/examples/package/package.mk b/examples/package/package.mk new file mode 100644 index 00000000..2bd4544f --- /dev/null +++ b/examples/package/package.mk @@ -0,0 +1,74 @@ +#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐ +#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘ +# +# SYNOPSIS +# +# Your package build config for executable programs +# +# DESCRIPTION +# +# We assume each .c file in this directory has a main() function, so +# that it becomes as easy as possible to write lots of tiny programs +# +# EXAMPLE +# +# make o//examples/package +# o/examples/package/program.com + +PKGS += EXAMPLES_PACKAGE + +# Reads into memory the list of files in this directory. +EXAMPLES_PACKAGE_FILES := $(wildcard examples/package/*) + +# Defines sets of files without needing further iops. +EXAMPLES_PACKAGE_SRCS = $(filter %.c,$(EXAMPLES_PACKAGE_FILES)) +EXAMPLES_PACKAGE_HDRS = $(filter %.h,$(EXAMPLES_PACKAGE_FILES)) +EXAMPLES_PACKAGE_COMS = $(EXAMPLES_PACKAGE_OBJS:%.o=%.com) + +# Remaps source file names to object names. +# Also asks a wildcard rule to automatically run tool/build/zipobj.c +EXAMPLES_PACKAGE_OBJS = \ + $(EXAMPLES_PACKAGE_SRCS:%.c=o/$(MODE)/%.o) \ + $(EXAMPLES_PACKAGE_SRCS:%=o/$(MODE)/%.zip.o) +EXAMPLES_PACKAGE_BINS = \ + $(EXAMPLES_PACKAGE_COMS) \ + $(EXAMPLES_PACKAGE_COMS:%=%.dbg) + +# Lists packages whose symbols are or may be directly referenced here. +# Note that linking stubs is always a good idea due to synthetic code. +EXAMPLES_PACKAGE_DIRECTDEPS = \ + EXAMPLES_PACKAGE_LIB \ + LIBC_STDIO \ + LIBC_STUBS \ + LIBC_TINYMATH + +# Evaluates the set of transitive package dependencies. +EXAMPLES_PACKAGE_DEPS := \ + $(call uniq,$(foreach x,$(EXAMPLES_PACKAGE_DIRECTDEPS),$($(x)))) + +# Invalidates objects in this package when this makefile is edited +$(EXAMPLES_PACKAGE_OBJS): examples/package/vizlib.mk + +# Asks packager to index symbols and validate their relationships. +# @see tool/build/package.c +# @see build/rules.mk +o/$(MODE)/examples/package/build.pkg: \ + $(EXAMPLES_PACKAGE_OBJS) \ + $(foreach x,$(EXAMPLES_PACKAGE_DIRECTDEPS),$($(x)_A).pkg) + +# Specifies how to build programs as ELF binaries with DWARF debug info. +# @see build/rules.mk for definition of rule that does .com.dbg -> .com +o/$(MODE)/examples/package/%.com.dbg: \ + $(EXAMPLES_PACKAGE_DEPS) \ + o/$(MODE)/examples/package/package.pkg \ + o/$(MODE)/examples/package/%.o \ + $(CRT) \ + $(APE) + -@$(APELINK) + +# Creates target that builds everything in this package and subpackages. +.PHONY: o/$(MODE)/examples/package +o/$(MODE)/examples/package: \ + o/$(MODE)/examples/package/lib \ + $(EXAMPLES_PACKAGE_BINS) \ + $(EXAMPLES_PACKAGE_CHECKS) diff --git a/examples/package/program.c b/examples/package/program.c new file mode 100644 index 00000000..44dcc1dc --- /dev/null +++ b/examples/package/program.c @@ -0,0 +1,6 @@ +#include "examples/package/lib/myprint.h" + +int main(int argc, char *argv[]) { + MyPrint("welcome to your package"); + return 0; +} diff --git a/examples/raw-linux-hello.S b/examples/tiny-raw-linux-tutorial.S similarity index 69% rename from examples/raw-linux-hello.S rename to examples/tiny-raw-linux-tutorial.S index 356a4567..a1eff11b 100644 --- a/examples/raw-linux-hello.S +++ b/examples/tiny-raw-linux-tutorial.S @@ -19,31 +19,42 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -/ Raw Linux Assembly Binary Tutorial +/ Tiny Raw Linux Binary Tutorial / / i.e. how to not use cosmopolitan runtimes at all / cosmopolitan basically abstracts this / except for all major platforms / -/ make o//examples/raw-linux-hello.elf -/ o//examples/raw-linux-hello.elf # about 6kb +/ make o//examples/raw-linux-hello.elf +/ o/examples/raw-linux-hello.elf # about 6kb / -/ Next consider doing it in C with fancy build tuning +/ Next try C but with fancy build tuning / -/ make -j8 -O \ -/ MODE=tiny \ -/ LDFLAGS=-s \ -/ CPPFLAGS=-DSUPPORT_VECTOR=0b00000001 \ -/ o/tiny/examples/hello2.elf -/ o/tiny/examples/hello2.elf # about 8kb +/ make -j8 -O \ +/ MODE=tiny \ +/ LDFLAGS+=-s \ +/ CPPFLAGS+=-DIM_FEELING_NAUGHTY \ +/ CPPFLAGS+=-DSUPPORT_VECTOR=0b00000001 \ +/ o/tiny/examples/hello2.elf +/ o/tiny/examples/hello2.elf # about 8kb / +/ @param rsp is [n,argv₀..argvₙ₋₁,0,envp₀..,0,auxv₀..,0,..] +/ @see also glibc static binaries which start at 800kb!!! +/ @see also go where interfaces sadly disempower ld prune +/ @see also the stl where bad linkage is due to tech debt +/ @see libc/macros-cpp.inc forthe getstr macro definition +/ @note libc/elf/elf.lds can be tinier with page align off +/ @note gas is more powerful than nasm due to rms notation / @noreturn _start: mov $12,%rdx # arg no. 3 is length getstr "hello world\n",%rsi,%esi # arg no. 2 is memory mov $1,%edi # arg no. 1 is stdout mov $1,%eax # write() - syscall # see libc/sysv/syscalls.sh + syscall # libc/sysv/syscalls.sh mov $0,%edi # arg no. 1 is success status mov $0xE7,%eax # exit_group() - syscall + syscall # context switch +0: rep nop # basic blockading + jmp 0b .endfn _start,globl + .source __FILE__ diff --git a/libc/alg/djbsort-avx2.S b/libc/alg/djbsort-avx2.S index 6cbe6f96..d8044bd7 100644 --- a/libc/alg/djbsort-avx2.S +++ b/libc/alg/djbsort-avx2.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .p2align 4 minmax_vector: diff --git a/libc/calls/g_ntstartupinfo_init.S b/libc/calls/g_ntstartupinfo_init.S index 1ad69406..32cac0de 100644 --- a/libc/calls/g_ntstartupinfo_init.S +++ b/libc/calls/g_ntstartupinfo_init.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .init.start 400,_init_g_ntstartupinfo ezlea g_ntstartupinfo,cx diff --git a/libc/calls/g_ntsysteminfo_init.S b/libc/calls/g_ntsysteminfo_init.S index 995305cc..c77b955e 100644 --- a/libc/calls/g_ntsysteminfo_init.S +++ b/libc/calls/g_ntsysteminfo_init.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .init.start 400,_init_g_ntsysteminfo ezlea g_ntsysteminfo,cx diff --git a/libc/calls/getntsyspath.S b/libc/calls/getntsyspath.S index 3e534963..07159ddc 100644 --- a/libc/calls/getntsyspath.S +++ b/libc/calls/getntsyspath.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Obtains WIN32 magic path, e.g. GetTempPathA. / diff --git a/libc/calls/hefty/mkntcmdline.c b/libc/calls/hefty/mkntcmdline.c index 335aef3a..839284b6 100644 --- a/libc/calls/hefty/mkntcmdline.c +++ b/libc/calls/hefty/mkntcmdline.c @@ -26,6 +26,7 @@ #include "libc/nexgen32e/hascharacter.h" #include "libc/runtime/runtime.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" #include "libc/sysv/consts/fileno.h" #include "libc/sysv/errfuns.h" diff --git a/libc/calls/hefty/mkntenvblock.c b/libc/calls/hefty/mkntenvblock.c index 6e061806..8777c25d 100644 --- a/libc/calls/hefty/mkntenvblock.c +++ b/libc/calls/hefty/mkntenvblock.c @@ -23,6 +23,7 @@ #include "libc/macros.h" #include "libc/mem/mem.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" #include "libc/sysv/errfuns.h" /** diff --git a/libc/calls/ktmppath.S b/libc/calls/ktmppath.S index 4b1bf1c9..e05109b8 100644 --- a/libc/calls/ktmppath.S +++ b/libc/calls/ktmppath.S @@ -40,4 +40,4 @@ kTmpPath: call __getntsyspath .init.end 300,_init_kTmpPath - .yoink __FILE__ + .source __FILE__ diff --git a/libc/calls/mkntpath.ncabi.c b/libc/calls/mkntpath.ncabi.c index c44249e3..5958354f 100644 --- a/libc/calls/mkntpath.ncabi.c +++ b/libc/calls/mkntpath.ncabi.c @@ -23,6 +23,7 @@ #include "libc/calls/internal.h" #include "libc/conv/conv.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" #include "libc/sysv/errfuns.h" /** diff --git a/libc/calls/onntconsoleevent_init.S b/libc/calls/onntconsoleevent_init.S index 632d1a59..eb44d0a9 100644 --- a/libc/calls/onntconsoleevent_init.S +++ b/libc/calls/onntconsoleevent_init.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .init.start 300,_init_onntconsoleevent ezlea onntconsoleevent$nt,cx diff --git a/libc/calls/onwincrash_init.S b/libc/calls/onwincrash_init.S index f665defe..d955d3e4 100644 --- a/libc/calls/onwincrash_init.S +++ b/libc/calls/onwincrash_init.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .init.start 300,_init_onwincrash pushpop 1,%rcx diff --git a/libc/calls/pipe-sysv.S b/libc/calls/pipe-sysv.S index ecdb6eda..c9c84589 100644 --- a/libc/calls/pipe-sysv.S +++ b/libc/calls/pipe-sysv.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dce.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Creates file descriptors for IPC. / diff --git a/libc/calls/setegid.S b/libc/calls/setegid.S index 027f8df6..08a1f335 100644 --- a/libc/calls/setegid.S +++ b/libc/calls/setegid.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Sets effective group ID. / diff --git a/libc/calls/seteuid.S b/libc/calls/seteuid.S index f5fa2220..c259766c 100644 --- a/libc/calls/seteuid.S +++ b/libc/calls/seteuid.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Sets effective user ID. / diff --git a/libc/calls/sigenter.S b/libc/calls/sigenter.S index c41ce624..aa4ce4fa 100644 --- a/libc/calls/sigenter.S +++ b/libc/calls/sigenter.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/internal.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / System Five signal handler. / diff --git a/libc/calls/thunks/ftruncate-sysv.S b/libc/calls/thunks/ftruncate-sysv.S index c2d848d7..f9c3dbeb 100644 --- a/libc/calls/thunks/ftruncate-sysv.S +++ b/libc/calls/thunks/ftruncate-sysv.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Directly calls ftruncate() impl on host o/s if available. ftruncate$sysv: diff --git a/libc/calls/thunks/gettemppatha-flunk.S b/libc/calls/thunks/gettemppatha-flunk.S index f82cd0f6..450f78b8 100644 --- a/libc/calls/thunks/gettemppatha-flunk.S +++ b/libc/calls/thunks/gettemppatha-flunk.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Calls GetTempPathA() w/ different API. / diff --git a/libc/calls/thunks/lseek-sysv.S b/libc/calls/thunks/lseek-sysv.S index 3204971d..db9531ee 100644 --- a/libc/calls/thunks/lseek-sysv.S +++ b/libc/calls/thunks/lseek-sysv.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dce.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Directly calls lseek() impl on host o/s if available. lseek$sysv: diff --git a/libc/calls/thunks/mmap-sysv.S b/libc/calls/thunks/mmap-sysv.S index ba039ebf..a799274e 100644 --- a/libc/calls/thunks/mmap-sysv.S +++ b/libc/calls/thunks/mmap-sysv.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Directly calls mmap() on system five host o/s. mmap$sysv: diff --git a/libc/calls/thunks/onntconsoleevent.S b/libc/calls/thunks/onntconsoleevent.S index f14b0806..1d5a8516 100644 --- a/libc/calls/thunks/onntconsoleevent.S +++ b/libc/calls/thunks/onntconsoleevent.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .text.windows -.yoink __FILE__ +.source __FILE__ onntconsoleevent$nt: ezlea onntconsoleevent,ax diff --git a/libc/calls/thunks/onwincrash.S b/libc/calls/thunks/onwincrash.S index 69e0a768..2ae350e9 100644 --- a/libc/calls/thunks/onwincrash.S +++ b/libc/calls/thunks/onwincrash.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .text.windows -.yoink __FILE__ +.source __FILE__ onwincrash$nt: ezlea onwincrash,ax diff --git a/libc/calls/thunks/pread-sysv.S b/libc/calls/thunks/pread-sysv.S index 5a76bb72..8008e63f 100644 --- a/libc/calls/thunks/pread-sysv.S +++ b/libc/calls/thunks/pread-sysv.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Directly calls pread() impl on host o/s if available. pread$sysv: diff --git a/libc/calls/thunks/preadv-sysv.S b/libc/calls/thunks/preadv-sysv.S index cc4bfcde..057bb8a8 100644 --- a/libc/calls/thunks/preadv-sysv.S +++ b/libc/calls/thunks/preadv-sysv.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Directly calls preadv() impl on host o/s if available. preadv$sysv: diff --git a/libc/calls/thunks/pwrite-sysv.S b/libc/calls/thunks/pwrite-sysv.S index 9a8da3a3..6950afa9 100644 --- a/libc/calls/thunks/pwrite-sysv.S +++ b/libc/calls/thunks/pwrite-sysv.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Directly calls pwrite() impl on host o/s if available. pwrite$sysv: diff --git a/libc/calls/thunks/pwritev-sysv.S b/libc/calls/thunks/pwritev-sysv.S index b23b476d..fb43057d 100644 --- a/libc/calls/thunks/pwritev-sysv.S +++ b/libc/calls/thunks/pwritev-sysv.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Directly calls pwritev() impl on host o/s if available. pwritev$sysv: diff --git a/libc/calls/thunks/truncate-sysv.S b/libc/calls/thunks/truncate-sysv.S index 98ec21aa..c71b29d3 100644 --- a/libc/calls/thunks/truncate-sysv.S +++ b/libc/calls/thunks/truncate-sysv.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Directly calls truncate() impl on host o/s if available. truncate$sysv: diff --git a/libc/crt/crt.S b/libc/crt/crt.S index 4a48c8b7..d8bec332 100644 --- a/libc/crt/crt.S +++ b/libc/crt/crt.S @@ -22,7 +22,7 @@ #include "libc/notice.inc" #include "libc/runtime/internal.h" .section .start,"ax",@progbits -.yoink __FILE__ +.source __FILE__ / System Five userspace program entrypoint. / diff --git a/libc/fmt/kerrnonames.S b/libc/fmt/kerrnonames.S index 16e04560..e012529f 100644 --- a/libc/fmt/kerrnonames.S +++ b/libc/fmt/kerrnonames.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/notice.inc" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Embeds ASCII names for errno constants into binary. / diff --git a/libc/fmt/stoa.c b/libc/fmt/stoa.c index a5bd920c..93152a39 100644 --- a/libc/fmt/stoa.c +++ b/libc/fmt/stoa.c @@ -26,6 +26,8 @@ #include "libc/nexgen32e/tinystrlen.h" #include "libc/str/internal.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" +#include "libc/str/tpencode.h" #include "libc/unicode/unicode.h" forceinline unsigned long tpiencode(wint_t wc) { diff --git a/libc/integral/c.inc b/libc/integral/c.inc index aece2fb4..089630e3 100644 --- a/libc/integral/c.inc +++ b/libc/integral/c.inc @@ -983,7 +983,7 @@ typedef uint64_t uintmax_t; /** * Pulls another module, by symbol, into linkage. - * The nop itself is discarded by the linker. + * @note nop is discarded by ape/ape.lds */ #define YOINK(SYMBOL) \ do { \ @@ -996,11 +996,30 @@ typedef uint64_t uintmax_t; : "X"(SYMBOL)); \ } while (0) +/** + * Pulls another module into linkage from top-level scope. + * @note nop is discarded by ape/ape.lds + */ #define STATIC_YOINK(SYMBOLSTR) \ asm(".pushsection .yoink\n\tnop\t\"" SYMBOLSTR "\"\n\t.popsection") +/** + * Pulls source file into ZIP portion of binary. + * @see build/rules.mk which defines the wildcard build rule %.zip.o + */ +#ifndef IM_FEELING_NAUGHTY +#define STATIC_YOINK_SOURCE(PATH) STATIC_YOINK(PATH) +#else +#define STATIC_YOINK_SOURCE(PATH) +#endif + +/** + * Pulls source code of object being compiled. + * @note automates better compliance with spirit of gpl terms + * @note headers need to call STATIC_YOINK_SOURCE() manually + */ #ifdef __SAUCE__ -STATIC_YOINK(__SAUCE__); +STATIC_YOINK_SOURCE(__SAUCE__); /* see build/definitions.mk */ #endif #ifndef __cplusplus diff --git a/libc/log/loglevel.S b/libc/log/loglevel.S index 247df9d8..be8beeaf 100644 --- a/libc/log/loglevel.S +++ b/libc/log/loglevel.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/log/log.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .bss .align 4 diff --git a/libc/log/oncrashthunks.S b/libc/log/oncrashthunks.S index ca893b95..e64d28ab 100644 --- a/libc/log/oncrashthunks.S +++ b/libc/log/oncrashthunks.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / These function names make it a bit more obvious which signal / caused the crash, particularly in the GDB GUI. They're coded diff --git a/libc/log/thunks/__check_fail_eq.S b/libc/log/thunks/__check_fail_eq.S index 1c49fe52..a52b9d2d 100644 --- a/libc/log/thunks/__check_fail_eq.S +++ b/libc/log/thunks/__check_fail_eq.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .text.unlikely -.yoink __FILE__ +.source __FILE__ / Code-size saving thunk for CHECK_EQ() in NDEBUG mode. __check_fail_eq: diff --git a/libc/log/thunks/__check_fail_ge.S b/libc/log/thunks/__check_fail_ge.S index b7612f93..b4dfbf57 100644 --- a/libc/log/thunks/__check_fail_ge.S +++ b/libc/log/thunks/__check_fail_ge.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .text.unlikely -.yoink __FILE__ +.source __FILE__ / Code-size saving thunk for CHECK_GE() in NDEBUG mode. __check_fail_ge: diff --git a/libc/log/thunks/__check_fail_gt.S b/libc/log/thunks/__check_fail_gt.S index c0da0fff..ee1e9abd 100644 --- a/libc/log/thunks/__check_fail_gt.S +++ b/libc/log/thunks/__check_fail_gt.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .text.unlikely -.yoink __FILE__ +.source __FILE__ / Code-size saving thunk for CHECK_GT() in NDEBUG mode. __check_fail_gt: diff --git a/libc/log/thunks/__check_fail_le.S b/libc/log/thunks/__check_fail_le.S index f2ae37bd..f22bac4f 100644 --- a/libc/log/thunks/__check_fail_le.S +++ b/libc/log/thunks/__check_fail_le.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .text.unlikely -.yoink __FILE__ +.source __FILE__ / Code-size saving thunk for CHECK_LE() in NDEBUG mode. __check_fail_le: diff --git a/libc/log/thunks/__check_fail_lt.S b/libc/log/thunks/__check_fail_lt.S index afb3420c..75e9fc1d 100644 --- a/libc/log/thunks/__check_fail_lt.S +++ b/libc/log/thunks/__check_fail_lt.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .text.unlikely -.yoink __FILE__ +.source __FILE__ / Code-size saving thunk for CHECK_LT() in NDEBUG mode. __check_fail_lt: diff --git a/libc/log/thunks/__check_fail_ndebug.S b/libc/log/thunks/__check_fail_ndebug.S index da27764e..01691a54 100644 --- a/libc/log/thunks/__check_fail_ndebug.S +++ b/libc/log/thunks/__check_fail_ndebug.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ __check_fail_ndebug: push %rbp diff --git a/libc/log/thunks/__check_fail_ne.S b/libc/log/thunks/__check_fail_ne.S index 57d18488..f70e7b3e 100644 --- a/libc/log/thunks/__check_fail_ne.S +++ b/libc/log/thunks/__check_fail_ne.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .text.unlikely -.yoink __FILE__ +.source __FILE__ / Code-size saving thunk for CHECK_NE() in NDEBUG mode. __check_fail_ne: diff --git a/libc/log/ubsanjmp.S b/libc/log/ubsanjmp.S index 85be6fd0..95fd492b 100644 --- a/libc/log/ubsanjmp.S +++ b/libc/log/ubsanjmp.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .text.unlikely -.yoink __FILE__ +.source __FILE__ __ubsan_default_options: ret diff --git a/libc/macros-cpp.inc b/libc/macros-cpp.inc index decdb4dd..9d33d5b4 100644 --- a/libc/macros-cpp.inc +++ b/libc/macros-cpp.inc @@ -87,6 +87,17 @@ ret .endm +/ Pulls source code file into ZIP portion of binary. +/ +/ @param symbol is quoted path relative to root e.g. __FILE__ +/ @see see libc/zipos/zipcentraldir.S +/ @see see libc/integral/c.inc +.macro .source symbol:req +#ifndef IM_FEELING_NAUGHTY + .yoink "\symbol" +#endif +.endm + / Inserts profiling hook in prologue if cc wants it. / / Cosmopolitan does this in a slightly different way from normal diff --git a/libc/math/__fesetround.S b/libc/math/__fesetround.S index 85027f7b..875f7c84 100644 --- a/libc/math/__fesetround.S +++ b/libc/math/__fesetround.S @@ -35,4 +35,4 @@ fesetround: pop %rcx ret .endfn fesetround,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/math/feraiseexcept.S b/libc/math/feraiseexcept.S index cb84376b..0642e078 100644 --- a/libc/math/feraiseexcept.S +++ b/libc/math/feraiseexcept.S @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" +#include "libc/macros.h" feraiseexcept: and $0x3f,%edi @@ -27,4 +27,4 @@ feraiseexcept: xor %eax,%eax ret .endfn feraiseexcept,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/math/fesetenv.S b/libc/math/fesetenv.S index 5efdae9d..fb1d7dc4 100644 --- a/libc/math/fesetenv.S +++ b/libc/math/fesetenv.S @@ -36,4 +36,4 @@ fesetenv: add $40,%rsp ret .endfn fesetenv,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/math/fetestexcept.S b/libc/math/fetestexcept.S index a2b9321c..07b39d77 100644 --- a/libc/math/fetestexcept.S +++ b/libc/math/fetestexcept.S @@ -29,4 +29,4 @@ fetestexcept: and %edi,%eax ret .endfn fetestexcept,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/mem/calloc-hook.S b/libc/mem/calloc-hook.S index a71e871e..e731545b 100644 --- a/libc/mem/calloc-hook.S +++ b/libc/mem/calloc-hook.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .initbss 800,_init_calloc hook$calloc: diff --git a/libc/mem/calloc.S b/libc/mem/calloc.S index 87569332..89273b44 100644 --- a/libc/mem/calloc.S +++ b/libc/mem/calloc.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" #include "libc/notice.inc" -.yoink __FILE__ +.source __FILE__ / Allocates n * itemsize bytes, initialized to zero. / diff --git a/libc/mem/free-cxx.S b/libc/mem/free-cxx.S index 788d67ac..c77bbf77 100644 --- a/libc/mem/free-cxx.S +++ b/libc/mem/free-cxx.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Frees memory the C++ way. / diff --git a/libc/mem/free-hook.S b/libc/mem/free-hook.S index 36161af1..37e44521 100644 --- a/libc/mem/free-hook.S +++ b/libc/mem/free-hook.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .initbss 800,_init_free hook$free: diff --git a/libc/mem/free.S b/libc/mem/free.S index 381d8780..d42a5682 100644 --- a/libc/mem/free.S +++ b/libc/mem/free.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Free memory returned by malloc() & co. / diff --git a/libc/mem/malloc-cxx.S b/libc/mem/malloc-cxx.S index 096e12c2..ef584930 100644 --- a/libc/mem/malloc-cxx.S +++ b/libc/mem/malloc-cxx.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Allocates memory the C++ way. / diff --git a/libc/mem/malloc-hook.S b/libc/mem/malloc-hook.S index c5b68f6b..4e749ff0 100644 --- a/libc/mem/malloc-hook.S +++ b/libc/mem/malloc-hook.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .initbss 800,_init_malloc hook$malloc: diff --git a/libc/mem/malloc.S b/libc/mem/malloc.S index 891fb494..024b5144 100644 --- a/libc/mem/malloc.S +++ b/libc/mem/malloc.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Allocates uninitialized memory. / diff --git a/libc/mem/malloc_usable_size.S b/libc/mem/malloc_usable_size.S index 201b4289..ae7a2e62 100644 --- a/libc/mem/malloc_usable_size.S +++ b/libc/mem/malloc_usable_size.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" #include "libc/notice.inc" -.yoink __FILE__ +.source __FILE__ / Returns the number of bytes you can actually use in / an allocated chunk, which may be more than you requested diff --git a/libc/mem/memalign-cxx.S b/libc/mem/memalign-cxx.S index d60301fc..78eb1988 100644 --- a/libc/mem/memalign-cxx.S +++ b/libc/mem/memalign-cxx.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Allocates aligned memory the C++ way. / diff --git a/libc/mem/memalign-hook.S b/libc/mem/memalign-hook.S index d4856b6b..0c792bee 100644 --- a/libc/mem/memalign-hook.S +++ b/libc/mem/memalign-hook.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .initbss 800,_init_memalign hook$memalign: diff --git a/libc/mem/memalign.S b/libc/mem/memalign.S index 7051c672..99b2a345 100644 --- a/libc/mem/memalign.S +++ b/libc/mem/memalign.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" #include "libc/notice.inc" -.yoink __FILE__ +.source __FILE__ / Allocates aligned memory. / diff --git a/libc/mem/posix_memalign.S b/libc/mem/posix_memalign.S index ed6fc4d6..dc6c6f24 100644 --- a/libc/mem/posix_memalign.S +++ b/libc/mem/posix_memalign.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Allocates aligned memory the POSIX way. / diff --git a/libc/mem/pvalloc.S b/libc/mem/pvalloc.S index b792e037..aee2b947 100644 --- a/libc/mem/pvalloc.S +++ b/libc/mem/pvalloc.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" #include "libc/notice.inc" -.yoink __FILE__ +.source __FILE__ / Equivalent to valloc(minimum-page-that-holds(n)), that is, / round up n to nearest PAGESIZE. diff --git a/libc/mem/realloc-hook.S b/libc/mem/realloc-hook.S index 67466d29..bae29ded 100644 --- a/libc/mem/realloc-hook.S +++ b/libc/mem/realloc-hook.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .initbss 800,_init_realloc hook$realloc: diff --git a/libc/mem/realloc.S b/libc/mem/realloc.S index 4564a49a..0e9bb81d 100644 --- a/libc/mem/realloc.S +++ b/libc/mem/realloc.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" #include "libc/notice.inc" -.yoink __FILE__ +.source __FILE__ / Allocates / resizes / frees memory, e.g. / diff --git a/libc/mem/realloc_in_place.S b/libc/mem/realloc_in_place.S index 8a118620..3dd762dc 100644 --- a/libc/mem/realloc_in_place.S +++ b/libc/mem/realloc_in_place.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" #include "libc/notice.inc" -.yoink __FILE__ +.source __FILE__ / Resizes the space allocated for p to size n, only if this can be / done without moving p (i.e., only if there is adjacent space diff --git a/libc/mem/valloc.S b/libc/mem/valloc.S index 3dd0b837..86702b0a 100644 --- a/libc/mem/valloc.S +++ b/libc/mem/valloc.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" #include "libc/notice.inc" -.yoink __FILE__ +.source __FILE__ / Equivalent to memalign(PAGESIZE, n). / diff --git a/libc/nexgen32e/atomicislockfree.S b/libc/nexgen32e/atomicislockfree.S index fe44f733..caf301a5 100644 --- a/libc/nexgen32e/atomicislockfree.S +++ b/libc/nexgen32e/atomicislockfree.S @@ -36,4 +36,4 @@ __atomic_is_lock_free: cmovnz %ecx,%eax .leafepilogue .endfn __atomic_is_lock_free,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/bcmp.S b/libc/nexgen32e/bcmp.S index b278f774..083c4446 100644 --- a/libc/nexgen32e/bcmp.S +++ b/libc/nexgen32e/bcmp.S @@ -30,4 +30,4 @@ / @return 0 if equal or nonzero bcmp: jmp *hook$memcmp(%rip) .endfn bcmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/bcopy.S b/libc/nexgen32e/bcopy.S index 55c5671e..34375ba1 100644 --- a/libc/nexgen32e/bcopy.S +++ b/libc/nexgen32e/bcopy.S @@ -28,5 +28,5 @@ / @param rdx is number of bytes bcopy: jmp memmove .endfn bcopy,globl - .yoink __FILE__ - .yoink __FILE__ + .source __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/bsf.S b/libc/nexgen32e/bsf.S index fb27f6ca..ba5fd9e3 100644 --- a/libc/nexgen32e/bsf.S +++ b/libc/nexgen32e/bsf.S @@ -40,4 +40,4 @@ bsf: .leafprologue bsf %edi,%eax .leafepilogue .endfn bsf,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/bsfl.S b/libc/nexgen32e/bsfl.S index 621ebba6..0b583658 100644 --- a/libc/nexgen32e/bsfl.S +++ b/libc/nexgen32e/bsfl.S @@ -41,4 +41,4 @@ bsfl: .leafprologue .leafepilogue .endfn bsfl,globl .alias bsfl,bsfll - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/bsr.S b/libc/nexgen32e/bsr.S index 9ed66cc6..f8c5407f 100644 --- a/libc/nexgen32e/bsr.S +++ b/libc/nexgen32e/bsr.S @@ -40,4 +40,4 @@ bsr: .leafprologue bsr %edi,%eax .leafepilogue .endfn bsr,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/bsrl.S b/libc/nexgen32e/bsrl.S index 136594ee..62050cbf 100644 --- a/libc/nexgen32e/bsrl.S +++ b/libc/nexgen32e/bsrl.S @@ -41,4 +41,4 @@ bsrl: .leafprologue .leafepilogue .endfn bsrl,globl .alias bsrl,bsrll - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/bsrmax.S b/libc/nexgen32e/bsrmax.S index a5fec4ac..19134179 100644 --- a/libc/nexgen32e/bsrmax.S +++ b/libc/nexgen32e/bsrmax.S @@ -44,4 +44,4 @@ bsrmax: .leafprologue 2: add $64,%eax jmp 1b .endfn bsrmax,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/bzero.S b/libc/nexgen32e/bzero.S index 1e8aac63..788f9a9f 100644 --- a/libc/nexgen32e/bzero.S +++ b/libc/nexgen32e/bzero.S @@ -32,4 +32,4 @@ bzero: mov %rsi,%rdx xor %esi,%esi jmp _memset .endfn bzero,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/cescapec.S b/libc/nexgen32e/cescapec.S index c733e0e3..5b578812 100644 --- a/libc/nexgen32e/cescapec.S +++ b/libc/nexgen32e/cescapec.S @@ -130,4 +130,4 @@ cescapectab: add $(8-.Lcescapectab.ro.size%8),%rsi .endif .init.end 300,_init_cescapec - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/clamp1.S b/libc/nexgen32e/clamp1.S index b7a59be3..6b28e9a0 100644 --- a/libc/nexgen32e/clamp1.S +++ b/libc/nexgen32e/clamp1.S @@ -32,4 +32,4 @@ clamp1: .leafprologue .Lmax: .rept 4 .float 0.99609375 .endr - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/cmpsb.S b/libc/nexgen32e/cmpsb.S index f3e52cae..6c0a377b 100644 --- a/libc/nexgen32e/cmpsb.S +++ b/libc/nexgen32e/cmpsb.S @@ -40,4 +40,4 @@ cmpsb: .leafprologue .Lneg1: .long -1 .endobj .Lneg1 .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/cmpsl.S b/libc/nexgen32e/cmpsl.S index 8d0d5f28..cb3dc368 100644 --- a/libc/nexgen32e/cmpsl.S +++ b/libc/nexgen32e/cmpsl.S @@ -40,4 +40,4 @@ cmpsl: .leafprologue .Lneg1: .long -1 .endobj .Lneg1 .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/cmpsq.S b/libc/nexgen32e/cmpsq.S index 94a07475..83099982 100644 --- a/libc/nexgen32e/cmpsq.S +++ b/libc/nexgen32e/cmpsq.S @@ -40,4 +40,4 @@ cmpsq: .leafprologue .Lneg1: .long -1 .endobj .Lneg1 .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/cmpsw.S b/libc/nexgen32e/cmpsw.S index 9f5daa76..8dd7435f 100644 --- a/libc/nexgen32e/cmpsw.S +++ b/libc/nexgen32e/cmpsw.S @@ -40,4 +40,4 @@ cmpsw: .leafprologue .Lneg1: .long -1 .endobj .Lneg1 .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/cmpub.S b/libc/nexgen32e/cmpub.S index 3ba55e83..56961c8a 100644 --- a/libc/nexgen32e/cmpub.S +++ b/libc/nexgen32e/cmpub.S @@ -40,4 +40,4 @@ cmpub: .leafprologue .Lneg1: .long -1 .endobj .Lneg1 .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/cmpul.S b/libc/nexgen32e/cmpul.S index d9c8f5f7..6a2fd201 100644 --- a/libc/nexgen32e/cmpul.S +++ b/libc/nexgen32e/cmpul.S @@ -40,4 +40,4 @@ cmpul: .leafprologue .Lneg1: .long -1 .endobj .Lneg1 .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/cmpuq.S b/libc/nexgen32e/cmpuq.S index 8a8a4e45..b5bb944f 100644 --- a/libc/nexgen32e/cmpuq.S +++ b/libc/nexgen32e/cmpuq.S @@ -40,4 +40,4 @@ cmpuq: .leafprologue .Lneg1: .long -1 .endobj .Lneg1 .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/cmpuw.S b/libc/nexgen32e/cmpuw.S index b628c22f..bd23135a 100644 --- a/libc/nexgen32e/cmpuw.S +++ b/libc/nexgen32e/cmpuw.S @@ -40,4 +40,4 @@ cmpuw: .leafprologue .Lneg1: .long -1 .endobj .Lneg1 .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/crc32-pclmul.S b/libc/nexgen32e/crc32-pclmul.S index 05e1a349..e555162c 100644 --- a/libc/nexgen32e/crc32-pclmul.S +++ b/libc/nexgen32e/crc32-pclmul.S @@ -260,4 +260,4 @@ crc32$pclmul: 4194304 7.025 7.059 7.030 462 8388607 7.082 6.980 6.997 464 8388608 7.051 6.985 6.999 464 */ - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/crc32.S b/libc/nexgen32e/crc32.S index 640be2c0..4adb3cc5 100644 --- a/libc/nexgen32e/crc32.S +++ b/libc/nexgen32e/crc32.S @@ -27,4 +27,4 @@ crc32: movslq %edx,%rdx jmp crc32_z .endfn crc32,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/crc32c.S b/libc/nexgen32e/crc32c.S index ca6c0158..c6135f32 100644 --- a/libc/nexgen32e/crc32c.S +++ b/libc/nexgen32e/crc32c.S @@ -43,4 +43,4 @@ crc32c: .quad 0 #endif stosq .init.end 300,_init_crc32c - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/crc32init.S b/libc/nexgen32e/crc32init.S index d0f93762..bc413bda 100644 --- a/libc/nexgen32e/crc32init.S +++ b/libc/nexgen32e/crc32init.S @@ -69,4 +69,4 @@ crc32init: leave ret .endfn crc32init,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/ctype.S b/libc/nexgen32e/ctype.S index 477ec90d..90f484c0 100644 --- a/libc/nexgen32e/ctype.S +++ b/libc/nexgen32e/ctype.S @@ -98,4 +98,4 @@ ctypep: pop %rsi and %esi,%eax ret .endfn ctypep - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/div10.greg.S b/libc/nexgen32e/div10.greg.S index 407d0ffc..637b6773 100644 --- a/libc/nexgen32e/div10.greg.S +++ b/libc/nexgen32e/div10.greg.S @@ -116,4 +116,4 @@ div10: .leafprologue pop %rbx .leafepilogue .endfn div10,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/div1000000000int64.greg.S b/libc/nexgen32e/div1000000000int64.greg.S index 2493aa8a..0822f65e 100644 --- a/libc/nexgen32e/div1000000000int64.greg.S +++ b/libc/nexgen32e/div1000000000int64.greg.S @@ -29,4 +29,4 @@ div1000000000int64: jmp tinydivsi .globl tinydivsi .endfn div1000000000int64,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/div1000000int64.greg.S b/libc/nexgen32e/div1000000int64.greg.S index 3f8a3617..7fc9f0e5 100644 --- a/libc/nexgen32e/div1000000int64.greg.S +++ b/libc/nexgen32e/div1000000int64.greg.S @@ -28,4 +28,4 @@ div1000000int64: movabs $0x431bde82d7b634db,%rdx jmp tinydivsi .endfn div1000000int64,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/div1000int64.greg.S b/libc/nexgen32e/div1000int64.greg.S index 5ec3dba6..ac5e28df 100644 --- a/libc/nexgen32e/div1000int64.greg.S +++ b/libc/nexgen32e/div1000int64.greg.S @@ -28,4 +28,4 @@ div1000int64: movabs $0x20c49ba5e353f7cf,%rdx jmp tinydivsi .endfn div1000int64,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/div10int64.greg.S b/libc/nexgen32e/div10int64.greg.S index a1c26fe8..3a7f412f 100644 --- a/libc/nexgen32e/div10int64.greg.S +++ b/libc/nexgen32e/div10int64.greg.S @@ -28,4 +28,4 @@ div10int64: movabs $0x6666666666666667,%rdx jmp tinydivsi .endfn div10int64,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/environ.S b/libc/nexgen32e/environ.S index 4f5ba6eb..80ce6f28 100644 --- a/libc/nexgen32e/environ.S +++ b/libc/nexgen32e/environ.S @@ -30,4 +30,4 @@ environ:.quad 0 .init.start 300,_init_environ mov %r14,environ(%rip) .init.end 300,_init_environ - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/explicit_bzero.S b/libc/nexgen32e/explicit_bzero.S index 872db8cd..de85d01b 100644 --- a/libc/nexgen32e/explicit_bzero.S +++ b/libc/nexgen32e/explicit_bzero.S @@ -47,4 +47,4 @@ explicit_bzero: xorps %xmm5,%xmm5 .leafepilogue .endfn explicit_bzero,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/ffs.S b/libc/nexgen32e/ffs.S index 1ac34d37..15b1d8e4 100644 --- a/libc/nexgen32e/ffs.S +++ b/libc/nexgen32e/ffs.S @@ -44,4 +44,4 @@ ffs: .leafprologue inc %eax .leafepilogue .endfn ffs,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/ffsl.S b/libc/nexgen32e/ffsl.S index 2ea53d21..e14c4ec7 100644 --- a/libc/nexgen32e/ffsl.S +++ b/libc/nexgen32e/ffsl.S @@ -45,4 +45,4 @@ ffsl: .leafprologue .leafepilogue .endfn ffsl,globl .alias ffsl,ffsll - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/g_argv.S b/libc/nexgen32e/g_argv.S index d061f61e..ba149b03 100644 --- a/libc/nexgen32e/g_argv.S +++ b/libc/nexgen32e/g_argv.S @@ -29,4 +29,4 @@ g_argv: .quad 0 mov %r13,%rax stosq .init.end 300,_init_g_argv - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/g_auxv.S b/libc/nexgen32e/g_auxv.S index ff6d9da2..ce1b5e93 100644 --- a/libc/nexgen32e/g_auxv.S +++ b/libc/nexgen32e/g_auxv.S @@ -28,4 +28,4 @@ g_auxv: .quad 0 mov %r15,%rax stosq .init.end 300,_init_g_auxv - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/g_runstate.S b/libc/nexgen32e/g_runstate.S index 0a49044a..ac436574 100644 --- a/libc/nexgen32e/g_runstate.S +++ b/libc/nexgen32e/g_runstate.S @@ -20,4 +20,4 @@ #include "libc/macros.h" .comm g_runstate,4 - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/gc.S b/libc/nexgen32e/gc.S index 57330b1f..cde05645 100644 --- a/libc/nexgen32e/gc.S +++ b/libc/nexgen32e/gc.S @@ -88,4 +88,4 @@ __garbage: stosq pop %rdi .init.end 100,_init_garbage - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/gclongjmp.S b/libc/nexgen32e/gclongjmp.S index 756ef777..dca4b832 100644 --- a/libc/nexgen32e/gclongjmp.S +++ b/libc/nexgen32e/gclongjmp.S @@ -59,4 +59,4 @@ gclongjmp: pop %rdi jmp 0b .endfn gclongjmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/hextoint.S b/libc/nexgen32e/hextoint.S index 82dd4e69..fd1cda34 100644 --- a/libc/nexgen32e/hextoint.S +++ b/libc/nexgen32e/hextoint.S @@ -30,4 +30,4 @@ hextoint: and $15,%eax .leafepilogue .endfn hextoint,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/identity.S b/libc/nexgen32e/identity.S index 49db535a..63d551f1 100644 --- a/libc/nexgen32e/identity.S +++ b/libc/nexgen32e/identity.S @@ -26,4 +26,4 @@ identity: mov %rdi,%rax ret .endfn identity,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/imapxlatab.S b/libc/nexgen32e/imapxlatab.S index 4207fdf4..416245eb 100644 --- a/libc/nexgen32e/imapxlatab.S +++ b/libc/nexgen32e/imapxlatab.S @@ -38,4 +38,4 @@ imapxlatab: loop 1b .leafepilogue .endfn imapxlatab,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iscntrl.S b/libc/nexgen32e/iscntrl.S index f3fc3804..cb93584b 100644 --- a/libc/nexgen32e/iscntrl.S +++ b/libc/nexgen32e/iscntrl.S @@ -32,4 +32,4 @@ iscntrl:.leafprologue and $1,%eax 1: .leafepilogue .endfn iscntrl,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/isgraph.S b/libc/nexgen32e/isgraph.S index b7ef7fc8..81acb214 100644 --- a/libc/nexgen32e/isgraph.S +++ b/libc/nexgen32e/isgraph.S @@ -35,4 +35,4 @@ isgraph:.leafprologue and %edx,%eax 1: .leafepilogue .endfn isgraph,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/ispunct.S b/libc/nexgen32e/ispunct.S index 83fa6088..fed90665 100644 --- a/libc/nexgen32e/ispunct.S +++ b/libc/nexgen32e/ispunct.S @@ -38,4 +38,4 @@ ispunct:.leafprologue sete %al 1: .leafepilogue .endfn ispunct,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswalnum.S b/libc/nexgen32e/iswalnum.S index abe1844c..45d82b8a 100644 --- a/libc/nexgen32e/iswalnum.S +++ b/libc/nexgen32e/iswalnum.S @@ -30,4 +30,4 @@ iswalnum: andl $6,%eax 1: .leafepilogue .endfn iswalnum,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswalpha.S b/libc/nexgen32e/iswalpha.S index e6d72eab..7e369299 100644 --- a/libc/nexgen32e/iswalpha.S +++ b/libc/nexgen32e/iswalpha.S @@ -31,4 +31,4 @@ iswalpha: movzbl %al,%eax 1: .leafepilogue .endfn iswalpha,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswblank.S b/libc/nexgen32e/iswblank.S index e92345bd..e3835cac 100644 --- a/libc/nexgen32e/iswblank.S +++ b/libc/nexgen32e/iswblank.S @@ -31,4 +31,4 @@ iswblank: movzbl %al,%eax 1: .leafepilogue .endfn iswblank,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswcntrl.S b/libc/nexgen32e/iswcntrl.S index be1699f6..cc8aaa2e 100644 --- a/libc/nexgen32e/iswcntrl.S +++ b/libc/nexgen32e/iswcntrl.S @@ -32,4 +32,4 @@ iswcntrl: and $1,%eax 1: .leafepilogue .endfn iswcntrl,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswdigit.S b/libc/nexgen32e/iswdigit.S index d2d8eb47..06ff6b97 100644 --- a/libc/nexgen32e/iswdigit.S +++ b/libc/nexgen32e/iswdigit.S @@ -31,4 +31,4 @@ iswdigit: movzbl %al,%eax 1: .leafepilogue .endfn iswdigit,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswgraph.S b/libc/nexgen32e/iswgraph.S index 630857a0..c64ad408 100644 --- a/libc/nexgen32e/iswgraph.S +++ b/libc/nexgen32e/iswgraph.S @@ -35,4 +35,4 @@ iswgraph: andl %edx,%eax 1: .leafepilogue .endfn iswgraph,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswlower.S b/libc/nexgen32e/iswlower.S index 72c50315..dfb1ddfc 100644 --- a/libc/nexgen32e/iswlower.S +++ b/libc/nexgen32e/iswlower.S @@ -31,4 +31,4 @@ iswlower: movzbl %al,%eax 1: .leafepilogue .endfn iswlower,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswprint.S b/libc/nexgen32e/iswprint.S index 49958425..434d96e7 100644 --- a/libc/nexgen32e/iswprint.S +++ b/libc/nexgen32e/iswprint.S @@ -32,4 +32,4 @@ iswprint: andl $1,%eax 1: .leafepilogue .endfn iswprint,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswpunct.S b/libc/nexgen32e/iswpunct.S index 817613a8..f47e4b52 100644 --- a/libc/nexgen32e/iswpunct.S +++ b/libc/nexgen32e/iswpunct.S @@ -36,4 +36,4 @@ iswpunct: sete %al 1: .leafepilogue .endfn iswpunct,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswspace.S b/libc/nexgen32e/iswspace.S index b91d9677..0e87e3eb 100644 --- a/libc/nexgen32e/iswspace.S +++ b/libc/nexgen32e/iswspace.S @@ -30,4 +30,4 @@ iswspace: andl $1,%eax 1: .leafepilogue .endfn iswspace,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswupper.S b/libc/nexgen32e/iswupper.S index 6e113b3d..fcaf2f79 100644 --- a/libc/nexgen32e/iswupper.S +++ b/libc/nexgen32e/iswupper.S @@ -31,4 +31,4 @@ iswupper: movzbl %al,%eax 1: .leafepilogue .endfn iswupper,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/iswxdigit.S b/libc/nexgen32e/iswxdigit.S index ba62f754..197794d5 100644 --- a/libc/nexgen32e/iswxdigit.S +++ b/libc/nexgen32e/iswxdigit.S @@ -31,4 +31,4 @@ iswxdigit: movzbl %al,%eax 1: .leafepilogue .endfn iswxdigit,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/kbase36.S b/libc/nexgen32e/kbase36.S index ec0ff85e..0b9167c0 100644 --- a/libc/nexgen32e/kbase36.S +++ b/libc/nexgen32e/kbase36.S @@ -44,4 +44,4 @@ kBase36:.zero 256 loop 0b add $255-'Z,%rdi .init.end 300,_init_kBase36 - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/kcp437.S b/libc/nexgen32e/kcp437.S index e6610c34..2c8a424c 100644 --- a/libc/nexgen32e/kcp437.S +++ b/libc/nexgen32e/kcp437.S @@ -93,4 +93,4 @@ kCp437: .short 0x00b0,0x2219,0x00b7,0x221a,0x207f,0x00b2,0x25a0,0x03bb #f8:°∙·√ⁿ²■λ .endobj kCp437,globl .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/kcpuids.S b/libc/nexgen32e/kcpuids.S index d0e003cf..22825775 100644 --- a/libc/nexgen32e/kcpuids.S +++ b/libc/nexgen32e/kcpuids.S @@ -85,4 +85,4 @@ kCpuids:.long 0,0,0,0 # EAX=0 (Basic Processor Info) #endif 5: pop %rbx .init.end 201,_init_kCpuids - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/kcrc32ctab.S b/libc/nexgen32e/kcrc32ctab.S index 79e84207..3550280e 100644 --- a/libc/nexgen32e/kcrc32ctab.S +++ b/libc/nexgen32e/kcrc32ctab.S @@ -39,4 +39,4 @@ kCrc32cTab: call crc32init pop %rsi .init.end 300,_init_kCrc32cTab - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/kcrc32tab.S b/libc/nexgen32e/kcrc32tab.S index 8f89985e..1090a144 100644 --- a/libc/nexgen32e/kcrc32tab.S +++ b/libc/nexgen32e/kcrc32tab.S @@ -39,4 +39,4 @@ kCrc32Tab: call crc32init pop %rsi .init.end 300,_init_kCrc32Tab - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/kctype.S b/libc/nexgen32e/kctype.S index eed6c1ac..dadbd1ca 100644 --- a/libc/nexgen32e/kctype.S +++ b/libc/nexgen32e/kctype.S @@ -60,4 +60,4 @@ kCtype: .rept 256 .init.start 300,_init_kCtype call rldecode .init.end 300,_init_kCtype - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/kreversebits.S b/libc/nexgen32e/kreversebits.S index e622b2fb..d9072d32 100644 --- a/libc/nexgen32e/kreversebits.S +++ b/libc/nexgen32e/kreversebits.S @@ -87,4 +87,4 @@ kReverseBits: .byte 0b00111111,0b10111111,0b01111111,0b11111111 .endobj kReverseBits,globl .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/ksha256tab.S b/libc/nexgen32e/ksha256tab.S index 908df33d..7a9198f8 100644 --- a/libc/nexgen32e/ksha256tab.S +++ b/libc/nexgen32e/ksha256tab.S @@ -30,4 +30,4 @@ kSha256Tab: .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 .endobj kSha256Tab,globl,hidden .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/ksigsetempty.S b/libc/nexgen32e/ksigsetempty.S index b09aa7c4..490eb896 100644 --- a/libc/nexgen32e/ksigsetempty.S +++ b/libc/nexgen32e/ksigsetempty.S @@ -36,4 +36,4 @@ kSigsetEmpty: .init.start 300,_init_kSigsetEmpty add $NSIG/8,%rdi .init.end 300,_init_kSigsetEmpty - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/ksigsetfull.S b/libc/nexgen32e/ksigsetfull.S index 286955e5..58d770ae 100644 --- a/libc/nexgen32e/ksigsetfull.S +++ b/libc/nexgen32e/ksigsetfull.S @@ -39,4 +39,4 @@ kSigsetFull: stosq .endr .init.end 300,_init_kSigsetFull - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/kstarttsc.S b/libc/nexgen32e/kstarttsc.S index a10119dc..f7d221d2 100644 --- a/libc/nexgen32e/kstarttsc.S +++ b/libc/nexgen32e/kstarttsc.S @@ -34,4 +34,4 @@ kStartTsc: xchg %edx,%eax stosl .init.end 200,_init_kStartTsc - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/ktolower.S b/libc/nexgen32e/ktolower.S index 03ab028b..df0f355b 100644 --- a/libc/nexgen32e/ktolower.S +++ b/libc/nexgen32e/ktolower.S @@ -58,4 +58,4 @@ kToLower16: .type gperf_downcase,@object .globl gperf_downcase gperf_downcase = kToLower - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/ktoupper.S b/libc/nexgen32e/ktoupper.S index 012a417f..533699aa 100644 --- a/libc/nexgen32e/ktoupper.S +++ b/libc/nexgen32e/ktoupper.S @@ -32,4 +32,4 @@ kToUpper: 0: subb $0x20,(%r8,%rcx) loop 0b .init.end 300,_init_kToUpper - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/llog10.S b/libc/nexgen32e/llog10.S index 33531570..57d20d45 100644 --- a/libc/nexgen32e/llog10.S +++ b/libc/nexgen32e/llog10.S @@ -64,4 +64,4 @@ llog10data: .quad 100000000000000000 .endobj llog10data .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/loadxmm.S b/libc/nexgen32e/loadxmm.S index 1f91c897..3e35b87b 100644 --- a/libc/nexgen32e/loadxmm.S +++ b/libc/nexgen32e/loadxmm.S @@ -43,4 +43,4 @@ loadxmm:.leafprologue movaps 0x70(%rdi),%xmm15 .leafepilogue .endfn loadxmm,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/lolendian.S b/libc/nexgen32e/lolendian.S index 49bc1857..4fb75f3f 100644 --- a/libc/nexgen32e/lolendian.S +++ b/libc/nexgen32e/lolendian.S @@ -76,4 +76,4 @@ htons: movzwl %di,%eax .endfn htole16,globl .endfn ntohs,globl .endfn bswap_16,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/longjmp.S b/libc/nexgen32e/longjmp.S index d64e1de4..2e93e2e0 100644 --- a/libc/nexgen32e/longjmp.S +++ b/libc/nexgen32e/longjmp.S @@ -41,4 +41,4 @@ longjmp:mov %esi,%eax mov 48(%rdi),%r15 jmp *56(%rdi) .endfn longjmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/lzcnt.S b/libc/nexgen32e/lzcnt.S index 95734c26..092a27b1 100644 --- a/libc/nexgen32e/lzcnt.S +++ b/libc/nexgen32e/lzcnt.S @@ -44,4 +44,4 @@ lzcnt: .leafprologue sub %ecx,%eax .leafepilogue .endfn lzcnt,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/lzcntl.S b/libc/nexgen32e/lzcntl.S index 35979c27..576c4243 100644 --- a/libc/nexgen32e/lzcntl.S +++ b/libc/nexgen32e/lzcntl.S @@ -44,4 +44,4 @@ lzcntl: .leafprologue sub %ecx,%eax .endfn lzcntl,globl .alias lzcntl,lzcntll - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/memcmp-avx2.S b/libc/nexgen32e/memcmp-avx2.S index 273421dd..25effea6 100644 --- a/libc/nexgen32e/memcmp-avx2.S +++ b/libc/nexgen32e/memcmp-avx2.S @@ -61,4 +61,4 @@ memcmp$avx2: 8: vxorps %ymm0,%ymm0,%ymm0 .leafepilogue .endfn memcmp$avx2,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/memcmp-hook.S b/libc/nexgen32e/memcmp-hook.S index 37a989f1..89ac2889 100644 --- a/libc/nexgen32e/memcmp-hook.S +++ b/libc/nexgen32e/memcmp-hook.S @@ -47,4 +47,4 @@ hook$memcmp: #endif /* TINY */ stosq .init.end 300,_init_memcmp - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/memcmp-sse2.S b/libc/nexgen32e/memcmp-sse2.S index eb3eb7e6..350aa35a 100644 --- a/libc/nexgen32e/memcmp-sse2.S +++ b/libc/nexgen32e/memcmp-sse2.S @@ -59,4 +59,4 @@ memcmp$sse2: 7: xor %eax,%eax 8: .leafepilogue .endfn memcmp$sse2,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/memcmp.S b/libc/nexgen32e/memcmp.S index 377030cb..1df73352 100644 --- a/libc/nexgen32e/memcmp.S +++ b/libc/nexgen32e/memcmp.S @@ -28,7 +28,7 @@ / @asyncsignalsafe memcmp: jmp *hook$memcmp(%rip) .endfn memcmp,globl - .yoink __FILE__ + .source __FILE__ /* cosmo memcmp() avx2 for #c per n where c ≈ 0.273ns N x1 x8 x64 mBps diff --git a/libc/nexgen32e/memcpy.S b/libc/nexgen32e/memcpy.S index cbd43a24..aa359e38 100644 --- a/libc/nexgen32e/memcpy.S +++ b/libc/nexgen32e/memcpy.S @@ -43,7 +43,7 @@ / @mode long / @asyncsignalsafe .align 16 - .yoink __FILE__ + .source __FILE__ memcpy: mov %rdi,%rax / 𝑠𝑙𝑖𝑑𝑒 diff --git a/libc/nexgen32e/memeqmask.S b/libc/nexgen32e/memeqmask.S index 1702648e..73d5d023 100644 --- a/libc/nexgen32e/memeqmask.S +++ b/libc/nexgen32e/memeqmask.S @@ -47,4 +47,4 @@ memeqmask: 1: mov %rdi,%rax .leafepilogue .endfn memeqmask,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/memjmpinit.S b/libc/nexgen32e/memjmpinit.S index 3b67250f..97db1a44 100644 --- a/libc/nexgen32e/memjmpinit.S +++ b/libc/nexgen32e/memjmpinit.S @@ -46,4 +46,4 @@ memjmpinit: lodsq ret .endfn memjmpinit,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/memmove.S b/libc/nexgen32e/memmove.S index 5ff04159..ab87b569 100644 --- a/libc/nexgen32e/memmove.S +++ b/libc/nexgen32e/memmove.S @@ -51,4 +51,4 @@ _memmove: .leafepilogue .endfn _memmove,globl,hidden .endfn memmove,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/mempcpy.S b/libc/nexgen32e/mempcpy.S index 5ad2cd7c..a68b3532 100644 --- a/libc/nexgen32e/mempcpy.S +++ b/libc/nexgen32e/mempcpy.S @@ -30,4 +30,4 @@ mempcpy:lea (%rdi,%rdx),%rax jmp _memcpy .endfn mempcpy,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/memrchr.S b/libc/nexgen32e/memrchr.S index 59761b97..ab399aea 100644 --- a/libc/nexgen32e/memrchr.S +++ b/libc/nexgen32e/memrchr.S @@ -60,4 +60,4 @@ memrchr:.leafprologue lea (%rdi,%rcx),%rax 9: .leafepilogue .endfn memrchr,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/memrchr16.S b/libc/nexgen32e/memrchr16.S index 8c4a6611..3f335aba 100644 --- a/libc/nexgen32e/memrchr16.S +++ b/libc/nexgen32e/memrchr16.S @@ -61,4 +61,4 @@ memrchr16: lea (%rdi,%rcx,2),%rax 9: .leafepilogue .endfn memrchr16,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/memrchr32.S b/libc/nexgen32e/memrchr32.S index ec4fab98..cdc1da7d 100644 --- a/libc/nexgen32e/memrchr32.S +++ b/libc/nexgen32e/memrchr32.S @@ -61,4 +61,4 @@ wmemrchr: lea (%rdi,%rcx,4),%rax 9: .leafepilogue .endfn wmemrchr,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/memset.S b/libc/nexgen32e/memset.S index 6a09e40c..93d90164 100644 --- a/libc/nexgen32e/memset.S +++ b/libc/nexgen32e/memset.S @@ -24,7 +24,7 @@ #include "libc/nexgen32e/x86feature.h" #include "libc/nexgen32e/macros.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Sets memory. / diff --git a/libc/nexgen32e/mod1000000000int64.greg.S b/libc/nexgen32e/mod1000000000int64.greg.S index bff6febb..40d6db8b 100644 --- a/libc/nexgen32e/mod1000000000int64.greg.S +++ b/libc/nexgen32e/mod1000000000int64.greg.S @@ -37,4 +37,4 @@ mod1000000000int64: mov %rdi,%rax ret .endfn mod1000000000int64,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/mod1000000int64.greg.S b/libc/nexgen32e/mod1000000int64.greg.S index ec377cb5..c6ec7a19 100644 --- a/libc/nexgen32e/mod1000000int64.greg.S +++ b/libc/nexgen32e/mod1000000int64.greg.S @@ -33,4 +33,4 @@ mod1000000int64: mov %rdi,%rax ret .endfn mod1000000int64,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/mod1000int64.greg.S b/libc/nexgen32e/mod1000int64.greg.S index 028e9fff..2b6f3829 100644 --- a/libc/nexgen32e/mod1000int64.greg.S +++ b/libc/nexgen32e/mod1000int64.greg.S @@ -33,4 +33,4 @@ mod1000int64: mov %rdi,%rax ret .endfn mod1000int64,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/mod10int64.greg.S b/libc/nexgen32e/mod10int64.greg.S index e708efed..14adfba3 100644 --- a/libc/nexgen32e/mod10int64.greg.S +++ b/libc/nexgen32e/mod10int64.greg.S @@ -34,4 +34,4 @@ mod10int64: mov %rdi,%rax ret .endfn mod10int64,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/nt2sysv.S b/libc/nexgen32e/nt2sysv.S index 449496e4..a09f971d 100644 --- a/libc/nexgen32e/nt2sysv.S +++ b/libc/nexgen32e/nt2sysv.S @@ -54,4 +54,4 @@ nt2sysv:push %rbp leave ret .endfn nt2sysv,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/program_invocation_name.S b/libc/nexgen32e/program_invocation_name.S index 0fa36067..dc5e7c6c 100644 --- a/libc/nexgen32e/program_invocation_name.S +++ b/libc/nexgen32e/program_invocation_name.S @@ -30,4 +30,4 @@ program_invocation_name: mov (%r13),%rax stosq .init.end 300,_init_program_invocation_name - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/rldecode.S b/libc/nexgen32e/rldecode.S index 8bbb6c82..2c7b4a09 100644 --- a/libc/nexgen32e/rldecode.S +++ b/libc/nexgen32e/rldecode.S @@ -38,4 +38,4 @@ rldecode: jmp 0b 2: .leafepilogue .endfn rldecode,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/savexmm.S b/libc/nexgen32e/savexmm.S index 0b1b48c1..1da77e41 100644 --- a/libc/nexgen32e/savexmm.S +++ b/libc/nexgen32e/savexmm.S @@ -43,4 +43,4 @@ savexmm:.leafprologue movaps %xmm15,0x70(%rdi) .leafepilogue .endfn savexmm,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/setjmp.S b/libc/nexgen32e/setjmp.S index a74d693c..5c184b9b 100644 --- a/libc/nexgen32e/setjmp.S +++ b/libc/nexgen32e/setjmp.S @@ -40,4 +40,4 @@ setjmp: lea 8(%rsp),%rax xor %eax,%eax ret .endfn setjmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/sgetc.S b/libc/nexgen32e/sgetc.S index 7e8207bc..e94fe1bd 100644 --- a/libc/nexgen32e/sgetc.S +++ b/libc/nexgen32e/sgetc.S @@ -46,4 +46,4 @@ sgetc: push %bp pop %bp ret .endfn sgetc,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/slowcall.S b/libc/nexgen32e/slowcall.S index 79f4874c..75dcd1dd 100644 --- a/libc/nexgen32e/slowcall.S +++ b/libc/nexgen32e/slowcall.S @@ -82,4 +82,4 @@ slowcall: pop %rbp ret .endfn slowcall,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strcasecmp.S b/libc/nexgen32e/strcasecmp.S index 60d5144f..71aea71f 100644 --- a/libc/nexgen32e/strcasecmp.S +++ b/libc/nexgen32e/strcasecmp.S @@ -63,4 +63,4 @@ strncasecmp: 4: pop %rbx .leafepilogue .endfn strncasecmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strcasecmp16.S b/libc/nexgen32e/strcasecmp16.S index 7f217e49..30c7dbc9 100644 --- a/libc/nexgen32e/strcasecmp16.S +++ b/libc/nexgen32e/strcasecmp16.S @@ -69,4 +69,4 @@ strncasecmp16: 4: pop %rbx .leafepilogue .endfn strncasecmp16,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strcaseconv.S b/libc/nexgen32e/strcaseconv.S index c1b57b85..024a8cce 100644 --- a/libc/nexgen32e/strcaseconv.S +++ b/libc/nexgen32e/strcaseconv.S @@ -85,4 +85,4 @@ strcaseconv: .endfn strcaseconv .endfn strtolower,globl .endfn strtoupper,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strcmp-avx.S b/libc/nexgen32e/strcmp-avx.S index 45be9376..ee19745e 100644 --- a/libc/nexgen32e/strcmp-avx.S +++ b/libc/nexgen32e/strcmp-avx.S @@ -87,4 +87,4 @@ strncmp$avx: sub %ecx,%eax jmp 5b .endfn strncmp$avx,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strcmp-hook.S b/libc/nexgen32e/strcmp-hook.S index 929628ee..b19d68ae 100644 --- a/libc/nexgen32e/strcmp-hook.S +++ b/libc/nexgen32e/strcmp-hook.S @@ -46,4 +46,4 @@ hook$strcmp: #endif /* TINY */ stosq .init.end 300,_init_strcmp - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strcmp.S b/libc/nexgen32e/strcmp.S index 78c1a616..54c7f340 100644 --- a/libc/nexgen32e/strcmp.S +++ b/libc/nexgen32e/strcmp.S @@ -28,4 +28,4 @@ / @asyncsignalsafe strcmp: jmp *hook$strcmp(%rip) .endfn strcmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strcmp16-hook.S b/libc/nexgen32e/strcmp16-hook.S index edbec19d..77b023b8 100644 --- a/libc/nexgen32e/strcmp16-hook.S +++ b/libc/nexgen32e/strcmp16-hook.S @@ -36,4 +36,4 @@ hook$strcmp16: ezlea strcmp16$k8,ax stosq .init.end 300,_init_strcmp16 - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strcmp16-k8.S b/libc/nexgen32e/strcmp16-k8.S index b9b6585d..184f802a 100644 --- a/libc/nexgen32e/strcmp16-k8.S +++ b/libc/nexgen32e/strcmp16-k8.S @@ -63,4 +63,4 @@ strncmp16$k8: pop %rbx .leafepilogue .endfn strncmp16$k8,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strcmp16.S b/libc/nexgen32e/strcmp16.S index 1761dfd8..7226542d 100644 --- a/libc/nexgen32e/strcmp16.S +++ b/libc/nexgen32e/strcmp16.S @@ -30,4 +30,4 @@ strcmp16: jmp *hook$strcmp16(%rip) .endfn strcmp16,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strcpyzbw.S b/libc/nexgen32e/strcpyzbw.S index 1eace178..a99aaac4 100644 --- a/libc/nexgen32e/strcpyzbw.S +++ b/libc/nexgen32e/strcpyzbw.S @@ -32,4 +32,4 @@ strcpyzbw: pop %rax .leafepilogue .endfn strcpyzbw,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strncmp-hook.S b/libc/nexgen32e/strncmp-hook.S index e18ae1bf..f127ddd2 100644 --- a/libc/nexgen32e/strncmp-hook.S +++ b/libc/nexgen32e/strncmp-hook.S @@ -46,4 +46,4 @@ hook$strncmp: #endif /* TINY */ stosq .init.end 300,_init_strncmp - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strncmp.S b/libc/nexgen32e/strncmp.S index 0975aab5..c7019315 100644 --- a/libc/nexgen32e/strncmp.S +++ b/libc/nexgen32e/strncmp.S @@ -28,4 +28,4 @@ / @asyncsignalsafe strncmp:jmp *hook$strncmp(%rip) .endfn strncmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strncmp16-hook.S b/libc/nexgen32e/strncmp16-hook.S index b2afa34f..901dddd2 100644 --- a/libc/nexgen32e/strncmp16-hook.S +++ b/libc/nexgen32e/strncmp16-hook.S @@ -36,4 +36,4 @@ hook$strncmp16: ezlea strncmp16$k8,ax stosq .init.end 300,_init_strncmp16 - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strncmp16.S b/libc/nexgen32e/strncmp16.S index fa9b31d5..de5b0635 100644 --- a/libc/nexgen32e/strncmp16.S +++ b/libc/nexgen32e/strncmp16.S @@ -29,4 +29,4 @@ strncmp16: jmp *hook$strncmp16(%rip) .endfn strncmp16,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strsak.S b/libc/nexgen32e/strsak.S index 411f4c6c..330a70c2 100644 --- a/libc/nexgen32e/strsak.S +++ b/libc/nexgen32e/strsak.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/nexgen32e/x86feature.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns pointer to first instance of character. / diff --git a/libc/nexgen32e/strsak16.S b/libc/nexgen32e/strsak16.S index 9e97d4c9..33c95b8f 100644 --- a/libc/nexgen32e/strsak16.S +++ b/libc/nexgen32e/strsak16.S @@ -183,4 +183,4 @@ strsak16: add %rcx,%rax jmp .Lword .endfn strsak16 - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strsak32.S b/libc/nexgen32e/strsak32.S index 255f4310..e10665fd 100644 --- a/libc/nexgen32e/strsak32.S +++ b/libc/nexgen32e/strsak32.S @@ -179,4 +179,4 @@ wcssak: lea -4(%rdi),%rax .endfn wcslen,globl .endfn wcschr,globl .endfn wcschrnul,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strstr-sse42.S b/libc/nexgen32e/strstr-sse42.S index d2b423dc..443dffd1 100644 --- a/libc/nexgen32e/strstr-sse42.S +++ b/libc/nexgen32e/strstr-sse42.S @@ -30,4 +30,4 @@ strstr$sse42: .strstr .Lequalordered .endfn strstr$sse42,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/strstr16-sse42.S b/libc/nexgen32e/strstr16-sse42.S index 1f7f6af3..e4c7d86d 100644 --- a/libc/nexgen32e/strstr16-sse42.S +++ b/libc/nexgen32e/strstr16-sse42.S @@ -30,4 +30,4 @@ strstr16$sse42: .strstr .Lequalorder16 .endfn strstr16$sse42,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/sysv2nt.S b/libc/nexgen32e/sysv2nt.S index 4c1370b1..4535afc9 100644 --- a/libc/nexgen32e/sysv2nt.S +++ b/libc/nexgen32e/sysv2nt.S @@ -60,4 +60,4 @@ __sysv2nt: .endfn __sysv2nt10,globl,hidden .endfn __sysv2nt12,globl,hidden .endfn __sysv2nt14,globl,hidden - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/tinydivsi.greg.S b/libc/nexgen32e/tinydivsi.greg.S index 36e0ea36..0a3509e6 100644 --- a/libc/nexgen32e/tinydivsi.greg.S +++ b/libc/nexgen32e/tinydivsi.greg.S @@ -35,4 +35,4 @@ tinydivsi: sub %rdi,%rax .leafepilogue .endfn tinydivsi,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/tinystrcmp.S b/libc/nexgen32e/tinystrcmp.S index 811170e6..2d59c0f3 100644 --- a/libc/nexgen32e/tinystrcmp.S +++ b/libc/nexgen32e/tinystrcmp.S @@ -44,4 +44,4 @@ tinystrcmp: pop %rcx .leafepilogue .endfn tinystrcmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/tinystrlen.greg.S b/libc/nexgen32e/tinystrlen.greg.S index 7806a271..cc0d92f8 100644 --- a/libc/nexgen32e/tinystrlen.greg.S +++ b/libc/nexgen32e/tinystrlen.greg.S @@ -34,4 +34,4 @@ tinystrlen: jmp 1b 2: .leafepilogue .endfn tinystrlen,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/tinystrlen16.greg.S b/libc/nexgen32e/tinystrlen16.greg.S index f36059b4..e79aa8d9 100644 --- a/libc/nexgen32e/tinystrlen16.greg.S +++ b/libc/nexgen32e/tinystrlen16.greg.S @@ -34,4 +34,4 @@ tinystrlen16: jmp 1b 2: .leafepilogue .endfn tinystrlen16,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/tinystrnlen.greg.S b/libc/nexgen32e/tinystrnlen.greg.S index 0ba37e9b..250b228b 100644 --- a/libc/nexgen32e/tinystrnlen.greg.S +++ b/libc/nexgen32e/tinystrnlen.greg.S @@ -37,4 +37,4 @@ tinystrnlen: jmp 1b 2: .leafepilogue .endfn tinystrnlen,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/tinystrnlen16.greg.S b/libc/nexgen32e/tinystrnlen16.greg.S index d75dbbd4..59c0aac2 100644 --- a/libc/nexgen32e/tinystrnlen16.greg.S +++ b/libc/nexgen32e/tinystrnlen16.greg.S @@ -37,4 +37,4 @@ tinystrnlen16: jmp 1b 2: .leafepilogue .endfn tinystrnlen16,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/tinywcslen.greg.S b/libc/nexgen32e/tinywcslen.greg.S index 483e25a3..fe02b3e9 100644 --- a/libc/nexgen32e/tinywcslen.greg.S +++ b/libc/nexgen32e/tinywcslen.greg.S @@ -34,4 +34,4 @@ tinywcslen: jmp 1b 2: .leafepilogue .endfn tinywcslen,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/tinywcsnlen.greg.S b/libc/nexgen32e/tinywcsnlen.greg.S index 58d35b19..88db2099 100644 --- a/libc/nexgen32e/tinywcsnlen.greg.S +++ b/libc/nexgen32e/tinywcsnlen.greg.S @@ -37,4 +37,4 @@ tinywcsnlen: jmp 1b 2: .leafepilogue .endfn tinywcsnlen,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/tolower.S b/libc/nexgen32e/tolower.S index f99d3cc1..87828433 100644 --- a/libc/nexgen32e/tolower.S +++ b/libc/nexgen32e/tolower.S @@ -28,4 +28,4 @@ tolower:.leafprologue movzbl (%rcx,%rax),%eax 1: .leafepilogue .endfn tolower,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/toupper.S b/libc/nexgen32e/toupper.S index 27ab4878..f62db8ab 100644 --- a/libc/nexgen32e/toupper.S +++ b/libc/nexgen32e/toupper.S @@ -32,4 +32,4 @@ toupper:.leafprologue andn %edi,%eax,%eax # TODO(jart): FIX 1: .leafepilogue .endfn toupper,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/towlower.S b/libc/nexgen32e/towlower.S index c31d1068..0f49ff2d 100644 --- a/libc/nexgen32e/towlower.S +++ b/libc/nexgen32e/towlower.S @@ -29,4 +29,4 @@ towlower: movzbl (%rcx,%rax),%eax 1: .leafepilogue .endfn towlower,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/towupper.S b/libc/nexgen32e/towupper.S index a265bfac..7bd7cc39 100644 --- a/libc/nexgen32e/towupper.S +++ b/libc/nexgen32e/towupper.S @@ -33,4 +33,4 @@ towupper: andn %edi,%edx,%eax 1: .leafepilogue .endfn towupper,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/tzcnt.S b/libc/nexgen32e/tzcnt.S index c8210b74..2f9ffef0 100644 --- a/libc/nexgen32e/tzcnt.S +++ b/libc/nexgen32e/tzcnt.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Finds lowest set bit in 𝑥. / diff --git a/libc/nexgen32e/tzcntl.S b/libc/nexgen32e/tzcntl.S index bf45f233..8c2f2b6e 100644 --- a/libc/nexgen32e/tzcntl.S +++ b/libc/nexgen32e/tzcntl.S @@ -43,4 +43,4 @@ tzcntl: .leafprologue .leafepilogue .endfn tzcntl,globl .alias tzcntl,tzcntll - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/vcls.S b/libc/nexgen32e/vcls.S index f26dbbbb..2b7ca842 100644 --- a/libc/nexgen32e/vcls.S +++ b/libc/nexgen32e/vcls.S @@ -22,7 +22,7 @@ #include "libc/notice.inc" .real .code16 # ∩ .code32 ∩ .code64 -.yoink __FILE__ +.source __FILE__ / Clears display page. / diff --git a/libc/nexgen32e/wcscasecmp.S b/libc/nexgen32e/wcscasecmp.S index 7af30d1e..1aee90e9 100644 --- a/libc/nexgen32e/wcscasecmp.S +++ b/libc/nexgen32e/wcscasecmp.S @@ -71,4 +71,4 @@ wcsncasecmp: .leafepilogue .endfn wcsncasecmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/wcscmp-hook.S b/libc/nexgen32e/wcscmp-hook.S index b2121dbd..d7aa0d33 100644 --- a/libc/nexgen32e/wcscmp-hook.S +++ b/libc/nexgen32e/wcscmp-hook.S @@ -31,4 +31,4 @@ hook$wcscmp: stosq .init.end 300,_init_wcscmp - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/wcscmp-k8.S b/libc/nexgen32e/wcscmp-k8.S index cd66e457..6dfaf95c 100644 --- a/libc/nexgen32e/wcscmp-k8.S +++ b/libc/nexgen32e/wcscmp-k8.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Compares NUL-terminated wchar_t strings. / diff --git a/libc/nexgen32e/wcscmp.S b/libc/nexgen32e/wcscmp.S index 3148954e..5356237a 100644 --- a/libc/nexgen32e/wcscmp.S +++ b/libc/nexgen32e/wcscmp.S @@ -28,4 +28,4 @@ / @note this stub is provided for abi compatibility wcscmp: jmp *hook$wcscmp(%rip) .endfn wcscmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/wcsncmp-hook.S b/libc/nexgen32e/wcsncmp-hook.S index 4b113c36..9b9f87bc 100644 --- a/libc/nexgen32e/wcsncmp-hook.S +++ b/libc/nexgen32e/wcsncmp-hook.S @@ -30,4 +30,4 @@ hook$wcsncmp: ezlea wcsncmp$k8,ax stosq .init.end 300,_init_wcsncmp - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/wcsncmp.S b/libc/nexgen32e/wcsncmp.S index c1703210..9b4be2fc 100644 --- a/libc/nexgen32e/wcsncmp.S +++ b/libc/nexgen32e/wcsncmp.S @@ -28,4 +28,4 @@ / @note this stub is provided for abi compatibility wcsncmp:jmp *hook$wcsncmp(%rip) .endfn wcsncmp,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/nexgen32e/xlm.S b/libc/nexgen32e/xlm.S index 5c812004..a5e345ad 100644 --- a/libc/nexgen32e/xlm.S +++ b/libc/nexgen32e/xlm.S @@ -30,4 +30,4 @@ __xlm: .rept XLM_SIZE .endr .endobj __xlm,globl,hidden .previous - .yoink __FILE__ + .source __FILE__ diff --git a/libc/notice.inc b/libc/notice.inc index 4ed33151..d57e8e91 100644 --- a/libc/notice.inc +++ b/libc/notice.inc @@ -1,4 +1,4 @@ -.ident "\n\ +.ident "\n\ Cosmopolitan\n\ Copyright 2020 Justine Alexandra Roberts Tunney\n\ \n\ diff --git a/libc/nt/ntdllimport.S b/libc/nt/ntdllimport.S index a8e5c632..efc15b96 100644 --- a/libc/nt/ntdllimport.S +++ b/libc/nt/ntdllimport.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/nt/enum/status.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / @fileoverview NTDLL.DLL Non-Mandatory Importer / diff --git a/libc/rand/g_rando.S b/libc/rand/g_rando.S index 2e6e728d..73724525 100644 --- a/libc/rand/g_rando.S +++ b/libc/rand/g_rando.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" #include "libc/notice.inc" -.yoink __FILE__ +.source __FILE__ .bss .align 8 diff --git a/libc/runtime/_exit.S b/libc/runtime/_exit.S index bd5f4723..0ace6801 100644 --- a/libc/runtime/_exit.S +++ b/libc/runtime/_exit.S @@ -21,7 +21,7 @@ #include "libc/runtime/internal.h" #include "libc/macros.h" .privileged -.yoink __FILE__ +.source __FILE__ / Terminates process, ignoring destructors and atexit() handlers. / diff --git a/libc/runtime/abort.S b/libc/runtime/abort.S index 2528abec..006c0cc0 100644 --- a/libc/runtime/abort.S +++ b/libc/runtime/abort.S @@ -23,7 +23,7 @@ #include "libc/sysv/consts/nr.h" #include "libc/macros.h" .real -.yoink __FILE__ +.source __FILE__ / Terminates program abnormally. / diff --git a/libc/runtime/cxaatexit.S b/libc/runtime/cxaatexit.S index d2108fd3..003646b7 100644 --- a/libc/runtime/cxaatexit.S +++ b/libc/runtime/cxaatexit.S @@ -20,7 +20,7 @@ #include "ape/relocations.h" #include "libc/macros.h" .section .text.exit,"ax",@progbits -.yoink __FILE__ +.source __FILE__ / Delegates to __cxa_atexit(). / diff --git a/libc/runtime/dsohandle.S b/libc/runtime/dsohandle.S index 0f8394c7..e59c5342 100644 --- a/libc/runtime/dsohandle.S +++ b/libc/runtime/dsohandle.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" #include "libc/notice.inc" -.yoink __FILE__ +.source __FILE__ / Uniquely identifies each artifact linked in an address space. __dso_handle: diff --git a/libc/runtime/fastmath.S b/libc/runtime/fastmath.S index 7809d228..7da5cfca 100644 --- a/libc/runtime/fastmath.S +++ b/libc/runtime/fastmath.S @@ -20,7 +20,7 @@ #include "libc/macros.h" #include "libc/notice.inc" .text.startup -.yoink __FILE__ +.source __FILE__ / Intel Manual V.1 §10.2.3 - MXCSR Control and Status Register #define MXCSR_DE (1 << 1) /* Denormal Flag */ diff --git a/libc/runtime/fpreset.S b/libc/runtime/fpreset.S index 7b7c8f45..a2f30e51 100644 --- a/libc/runtime/fpreset.S +++ b/libc/runtime/fpreset.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Re-initializes FPU. fpreset: diff --git a/libc/runtime/g_argc.S b/libc/runtime/g_argc.S index 924da7be..25552f50 100644 --- a/libc/runtime/g_argc.S +++ b/libc/runtime/g_argc.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .initbss 300,_init_g_argc g_argc: .quad 0 diff --git a/libc/runtime/getdosargv.c b/libc/runtime/getdosargv.c index c4983400..1ec8a435 100644 --- a/libc/runtime/getdosargv.c +++ b/libc/runtime/getdosargv.c @@ -23,11 +23,12 @@ #include "libc/runtime/internal.h" #include "libc/str/appendchar.h" #include "libc/str/str.h" +#include "libc/str/tpenc.h" /* TODO(jart): Make early-stage data structures happen. */ #undef isspace #undef iswspace -#define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r') +#define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r') #define iswspace(c) isspace(c) struct DosArgv { @@ -37,14 +38,12 @@ struct DosArgv { wint_t wc; }; -static textwindows void decodedosargv(struct DosArgv *st) { +static inline textwindows void decodedosargv(struct DosArgv *st) { st->s += getutf16(st->s, &st->wc); } -static textwindows void appenddosargv(struct DosArgv *st, wint_t wc) { - if (st->p < st->pe) { - st->p += tpencode(st->p, st->pe - st->p, wc, false); - } +static inline textwindows void appenddosargv(struct DosArgv *st, wint_t wc) { + AppendChar(&st->p, st->pe, wc); } /** diff --git a/libc/runtime/getpagesize.S b/libc/runtime/getpagesize.S index f7c801f7..20b672ca 100644 --- a/libc/runtime/getpagesize.S +++ b/libc/runtime/getpagesize.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns granularity of memory manager. getpagesize: diff --git a/libc/runtime/init.S b/libc/runtime/init.S index 14673e0e..8f41754c 100644 --- a/libc/runtime/init.S +++ b/libc/runtime/init.S @@ -21,7 +21,7 @@ #include "libc/runtime/internal.h" #include "libc/sysv/consts/prot.h" #include "libc/dce.h" -.yoink __FILE__ +.source __FILE__ / Decentralized function for process initialization. / diff --git a/libc/runtime/kntsystemdirectory.S b/libc/runtime/kntsystemdirectory.S index 0a4850a8..fdbc1a68 100644 --- a/libc/runtime/kntsystemdirectory.S +++ b/libc/runtime/kntsystemdirectory.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ #define BYTES 64 diff --git a/libc/runtime/kntwindowsdirectory.S b/libc/runtime/kntwindowsdirectory.S index 567c7aad..d7b36463 100644 --- a/libc/runtime/kntwindowsdirectory.S +++ b/libc/runtime/kntwindowsdirectory.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ #define BYTES 64 diff --git a/libc/runtime/mapanon-thunk.S b/libc/runtime/mapanon-thunk.S index 3b553d6c..fa43daf9 100644 --- a/libc/runtime/mapanon-thunk.S +++ b/libc/runtime/mapanon-thunk.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ mapanon:push %rbp mov %rsp,%rbp diff --git a/libc/runtime/mergepages.S b/libc/runtime/mergepages.S index 6315b402..aff5fdbc 100644 --- a/libc/runtime/mergepages.S +++ b/libc/runtime/mergepages.S @@ -22,7 +22,7 @@ #include "libc/sysv/consts/nr.h" #include "libc/macros.h" .text.startup -.yoink __FILE__ +.source __FILE__ / Merges page table entries for pages with identical content. / diff --git a/libc/runtime/munmap-thunk.S b/libc/runtime/munmap-thunk.S index 5b9b5ce0..484c5cdd 100644 --- a/libc/runtime/munmap-thunk.S +++ b/libc/runtime/munmap-thunk.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ munmap: push %rbp mov %rsp,%rbp diff --git a/libc/runtime/peekall.S b/libc/runtime/peekall.S index 2aedba12..f29db175 100644 --- a/libc/runtime/peekall.S +++ b/libc/runtime/peekall.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/relocations.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Loads all pages from program image into memory. peekall:.leafprologue diff --git a/libc/runtime/progname.S b/libc/runtime/progname.S index b13d9faf..10ca9358 100644 --- a/libc/runtime/progname.S +++ b/libc/runtime/progname.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Provides argv[0] The BSD Way. .initbss 300,_init___progname diff --git a/libc/runtime/program_invocation_short_name.S b/libc/runtime/program_invocation_short_name.S index 9c59b9d5..eae3d597 100644 --- a/libc/runtime/program_invocation_short_name.S +++ b/libc/runtime/program_invocation_short_name.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Supplies basename(argv[0]) The GNU Way. .initbss 400,_init_program_invocation_short_name diff --git a/libc/runtime/startmain.S b/libc/runtime/startmain.S index 7571e453..c325bb78 100644 --- a/libc/runtime/startmain.S +++ b/libc/runtime/startmain.S @@ -26,7 +26,7 @@ #include "libc/runtime/mappings.h" #include "libc/sysv/consts/prot.h" .text.startup -.yoink __FILE__ +.source __FILE__ / Cosmopolitan process entrypoint. / diff --git a/libc/runtime/weakfree.S b/libc/runtime/weakfree.S index 5c4a3319..7cc54a23 100644 --- a/libc/runtime/weakfree.S +++ b/libc/runtime/weakfree.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Thunks free() if it's linked, otherwise do nothing. / diff --git a/libc/stdio/fputwc.c b/libc/stdio/fputwc.c index 7c99f6b6..10a1680e 100644 --- a/libc/stdio/fputwc.c +++ b/libc/stdio/fputwc.c @@ -22,6 +22,7 @@ #include "libc/stdio/internal.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" +#include "libc/str/tpencode.h" /** * Writes wide character to stream. @@ -29,8 +30,8 @@ * @return wc if written or -1 w/ errno */ wint_t fputwc(wchar_t wc, FILE *f) { + unsigned i, len; char buf[MB_LEN_MAX]; - unsigned len, i; if (wc != -1) { len = tpencode(buf, sizeof(buf), wc, false); for (i = 0; i < len; ++i) { diff --git a/libc/stdio/fseeko.S b/libc/stdio/fseeko.S index 379bad7a..791081db 100644 --- a/libc/stdio/fseeko.S +++ b/libc/stdio/fseeko.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fseeko: jmp fseek .endfn fseeko,globl diff --git a/libc/stdio/ftello.S b/libc/stdio/ftello.S index 83e511ac..dd4419a4 100644 --- a/libc/stdio/ftello.S +++ b/libc/stdio/ftello.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ ftello: jmp ftell .endfn ftello,globl diff --git a/libc/stdio/g_stderr_init.S b/libc/stdio/g_stderr_init.S index da4b5143..eece4a8a 100644 --- a/libc/stdio/g_stderr_init.S +++ b/libc/stdio/g_stderr_init.S @@ -22,7 +22,7 @@ #include "libc/calls/calls.h" #include "libc/sysv/consts/fileno.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .init.start 400,_init_g_stderr lea g_stderr(%rip),%rax diff --git a/libc/stdio/g_stdin_init.S b/libc/stdio/g_stdin_init.S index 901c7deb..db99ad29 100644 --- a/libc/stdio/g_stdin_init.S +++ b/libc/stdio/g_stdin_init.S @@ -22,7 +22,7 @@ #include "libc/calls/calls.h" #include "libc/sysv/consts/fileno.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .init.start 400,_init_g_stdin lea g_stdin(%rip),%rax diff --git a/libc/stdio/g_stdout_init.S b/libc/stdio/g_stdout_init.S index 1a51909f..89a753bf 100644 --- a/libc/stdio/g_stdout_init.S +++ b/libc/stdio/g_stdout_init.S @@ -22,7 +22,7 @@ #include "libc/calls/calls.h" #include "libc/sysv/consts/fileno.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .init.start 400,_init_g_stdout lea g_stdout(%rip),%rax diff --git a/libc/stdio/getc.S b/libc/stdio/getc.S index ef8bb3f3..2b81a668 100644 --- a/libc/stdio/getc.S +++ b/libc/stdio/getc.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" #include "libc/notice.inc" -.yoink __FILE__ +.source __FILE__ getc: jmp fgetc .endfn getc,globl diff --git a/libc/stdio/getchar.S b/libc/stdio/getchar.S index 504d20d2..448363ab 100644 --- a/libc/stdio/getchar.S +++ b/libc/stdio/getchar.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Reads uint8_t from standard input. / @return %al has result w/ rest of %rax cleared diff --git a/libc/stdio/getwc.S b/libc/stdio/getwc.S index 94ed4346..9140b965 100644 --- a/libc/stdio/getwc.S +++ b/libc/stdio/getwc.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ getwc: jmp fgetwc .endfn getwc,globl diff --git a/libc/stdio/getwchar.S b/libc/stdio/getwchar.S index e9d9e6f4..6a07c749 100644 --- a/libc/stdio/getwchar.S +++ b/libc/stdio/getwchar.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Reads Thompson-Pike encoded varint from standard input. / @return %eax has result w/ rest of %rax cleared diff --git a/libc/stdio/putc.S b/libc/stdio/putc.S index dd32608d..42d1456b 100644 --- a/libc/stdio/putc.S +++ b/libc/stdio/putc.S @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" -.yoink __FILE__ +#include "libc/macros.h" +.source __FILE__ putc: jmp fputc .endfn putc,globl diff --git a/libc/stdio/putwc.S b/libc/stdio/putwc.S index 5611de50..7ea4c832 100644 --- a/libc/stdio/putwc.S +++ b/libc/stdio/putwc.S @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" -.yoink __FILE__ +#include "libc/macros.h" +.source __FILE__ / Writes wide character to stream. / @param %edi is the wide character diff --git a/libc/stdio/unlocked/clearerr_unlocked.S b/libc/stdio/unlocked/clearerr_unlocked.S index c93e8e68..1381b79b 100644 --- a/libc/stdio/unlocked/clearerr_unlocked.S +++ b/libc/stdio/unlocked/clearerr_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ clearerr_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/feof_unlocked.S b/libc/stdio/unlocked/feof_unlocked.S index 61402fb2..b707c1c4 100644 --- a/libc/stdio/unlocked/feof_unlocked.S +++ b/libc/stdio/unlocked/feof_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ feof_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/ferror_unlocked.S b/libc/stdio/unlocked/ferror_unlocked.S index d620a0c3..0b702e03 100644 --- a/libc/stdio/unlocked/ferror_unlocked.S +++ b/libc/stdio/unlocked/ferror_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ ferror_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fflush_unlocked.S b/libc/stdio/unlocked/fflush_unlocked.S index 1d026b51..574c0e65 100644 --- a/libc/stdio/unlocked/fflush_unlocked.S +++ b/libc/stdio/unlocked/fflush_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fflush_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fgetc_unlocked.S b/libc/stdio/unlocked/fgetc_unlocked.S index dde34fbc..e9b7cccf 100644 --- a/libc/stdio/unlocked/fgetc_unlocked.S +++ b/libc/stdio/unlocked/fgetc_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fgetc_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fgets_unlocked.S b/libc/stdio/unlocked/fgets_unlocked.S index 03b14548..d995c0e5 100644 --- a/libc/stdio/unlocked/fgets_unlocked.S +++ b/libc/stdio/unlocked/fgets_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fgets_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fgetwc_unlocked.S b/libc/stdio/unlocked/fgetwc_unlocked.S index d7a682aa..c5523c82 100644 --- a/libc/stdio/unlocked/fgetwc_unlocked.S +++ b/libc/stdio/unlocked/fgetwc_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fgetwc_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fgetws_unlocked.S b/libc/stdio/unlocked/fgetws_unlocked.S index 83d589d5..de10b578 100644 --- a/libc/stdio/unlocked/fgetws_unlocked.S +++ b/libc/stdio/unlocked/fgetws_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fgetws_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fileno_unlocked.S b/libc/stdio/unlocked/fileno_unlocked.S index 1653507d..619b3ee0 100644 --- a/libc/stdio/unlocked/fileno_unlocked.S +++ b/libc/stdio/unlocked/fileno_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fileno_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fputc_unlocked.S b/libc/stdio/unlocked/fputc_unlocked.S index f077d0ba..fa5d3c93 100644 --- a/libc/stdio/unlocked/fputc_unlocked.S +++ b/libc/stdio/unlocked/fputc_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fputc_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fputs_unlocked.S b/libc/stdio/unlocked/fputs_unlocked.S index 260d907c..84dd51f9 100644 --- a/libc/stdio/unlocked/fputs_unlocked.S +++ b/libc/stdio/unlocked/fputs_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fputs_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fputwc_unlocked.S b/libc/stdio/unlocked/fputwc_unlocked.S index f53c4fa6..0e6dcd82 100644 --- a/libc/stdio/unlocked/fputwc_unlocked.S +++ b/libc/stdio/unlocked/fputwc_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fputwc_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fputws_unlocked.S b/libc/stdio/unlocked/fputws_unlocked.S index 03ba73df..55b1dee2 100644 --- a/libc/stdio/unlocked/fputws_unlocked.S +++ b/libc/stdio/unlocked/fputws_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fputws_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fread_unlocked.S b/libc/stdio/unlocked/fread_unlocked.S index c1914067..dc68d7c1 100644 --- a/libc/stdio/unlocked/fread_unlocked.S +++ b/libc/stdio/unlocked/fread_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fread_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/fwrite_unlocked.S b/libc/stdio/unlocked/fwrite_unlocked.S index 8101b4f7..7e77e8dd 100644 --- a/libc/stdio/unlocked/fwrite_unlocked.S +++ b/libc/stdio/unlocked/fwrite_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fwrite_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/getc_unlocked.S b/libc/stdio/unlocked/getc_unlocked.S index 0c3afcf6..c3fce1b5 100644 --- a/libc/stdio/unlocked/getc_unlocked.S +++ b/libc/stdio/unlocked/getc_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ getc_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/getchar_unlocked.S b/libc/stdio/unlocked/getchar_unlocked.S index 2c28604a..2a85f4e6 100644 --- a/libc/stdio/unlocked/getchar_unlocked.S +++ b/libc/stdio/unlocked/getchar_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ getchar_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/getwc_unlocked.S b/libc/stdio/unlocked/getwc_unlocked.S index 1aa735fb..657b6625 100644 --- a/libc/stdio/unlocked/getwc_unlocked.S +++ b/libc/stdio/unlocked/getwc_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ getwc_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/getwchar_unlocked.S b/libc/stdio/unlocked/getwchar_unlocked.S index 05b9a9ee..4faff448 100644 --- a/libc/stdio/unlocked/getwchar_unlocked.S +++ b/libc/stdio/unlocked/getwchar_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ getwchar_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/putc_unlocked.S b/libc/stdio/unlocked/putc_unlocked.S index 4ea2e5dd..8d65422e 100644 --- a/libc/stdio/unlocked/putc_unlocked.S +++ b/libc/stdio/unlocked/putc_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ putc_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/putchar_unlocked.S b/libc/stdio/unlocked/putchar_unlocked.S index ba62c3db..dbafa621 100644 --- a/libc/stdio/unlocked/putchar_unlocked.S +++ b/libc/stdio/unlocked/putchar_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ putchar_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/putwc_unlocked.S b/libc/stdio/unlocked/putwc_unlocked.S index ab5f4daa..29f0d854 100644 --- a/libc/stdio/unlocked/putwc_unlocked.S +++ b/libc/stdio/unlocked/putwc_unlocked.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ putwc_unlocked: .leafprologue diff --git a/libc/stdio/unlocked/putwchar_unlocked.S b/libc/stdio/unlocked/putwchar_unlocked.S index 46a5d5ea..32d6d280 100644 --- a/libc/stdio/unlocked/putwchar_unlocked.S +++ b/libc/stdio/unlocked/putwchar_unlocked.S @@ -19,7 +19,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ putwchar_unlocked: .leafprologue diff --git a/libc/str/appendchar.h b/libc/str/appendchar.h index cec840c4..cc39c943 100644 --- a/libc/str/appendchar.h +++ b/libc/str/appendchar.h @@ -1,10 +1,17 @@ #ifndef COSMOPOLITAN_LIBC_RUNTIME_APPENDCHAR_H_ #define COSMOPOLITAN_LIBC_RUNTIME_APPENDCHAR_H_ #include "libc/str/str.h" +#include "libc/str/tpenc.h" +#include "libc/str/tpencode.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) -forceinline void AppendChar(char **p, char *pe, wint_t c) { - if (*p < pe) *p += tpencode(*p, pe - *p, c, false); +static inline void AppendChar(char **p, char *pe, wint_t wc) { + uint64_t w; + w = tpenc(wc); + do { + if (*p >= pe) break; + *(*p)++ = w & 0xff; + } while (w >>= 8); } #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ diff --git a/libc/str/ktpdecoderring.S b/libc/str/ktpdecoderring.S index 3101d3b7..0731e76f 100644 --- a/libc/str/ktpdecoderring.S +++ b/libc/str/ktpdecoderring.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Thompson-Pike Decoder Ring. / diff --git a/libc/str/mbtowc.c b/libc/str/mbtowc.c index 31c778a4..658c6005 100644 --- a/libc/str/mbtowc.c +++ b/libc/str/mbtowc.c @@ -20,6 +20,7 @@ #include "libc/limits.h" #include "libc/macros.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" compatfn int mbtowc(wchar_t *wc, const char *s, size_t n) { if (!s) return 0; diff --git a/libc/str/rindex.S b/libc/str/rindex.S index 8a33ce9e..8c9bdb91 100644 --- a/libc/str/rindex.S +++ b/libc/str/rindex.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns pointer to last instance of character the BSD way. / diff --git a/libc/str/str.h b/libc/str/str.h index 8616f474..c6e080f5 100644 --- a/libc/str/str.h +++ b/libc/str/str.h @@ -68,9 +68,6 @@ void *isnotplaintext(const void *, size_t) nothrow nocallback nosideeffect; #define UTF16_MOAR 0b1101100000000000 /* 0xD800..0xDBFF */ #define UTF16_CONT 0b1101110000000000 /* 0xDC00..0xDBFF */ -unsigned tpencode(char *buf, size_t size, wint_t c, bool32 awesome) - paramsnonnull() libcesque; -int tpdecode(const char *s, wint_t *out) paramsnonnull((1)) libcesque; unsigned getutf16(const char16_t *p, wint_t *wc); int pututf16(char16_t *s, size_t size, wint_t wc, bool awesome); int iswalnum(wint_t); @@ -532,45 +529,11 @@ extern int (*const hook$wcsncmp)(const wchar_t *, const wchar_t *, size_t); __builtin_strlen(s), _strlen(s)) #endif /* C11+ */ -#define tpencode(BUF, SIZE, CH, AWESOME) __tpencode(BUF, SIZE, CH, AWESOME) #define pututf16(BUF, SIZE, CH, AWESOME) __pututf16(BUF, SIZE, CH, AWESOME) #define getutf16(BUF, CHPTR) __getutf16(BUF, CHPTR) -#define tpdecode(S, OUT) __tpdecode(S, OUT) size_t _strlen(const char *s) asm("strlen") strlenesque; char *_strchr(const char *, int) asm("strchr") strlenesque; void *_memchr(const void *, int, size_t) asm("memchr") strlenesque; -forceinline unsigned __tpencode(char *s, size_t size, wint_t wc, - bool32 awesome) { - unsigned char *p = (unsigned char *)s; - if (size >= 1 && (0x00 <= wc && wc <= 0x7f)) { - if (wc >= 32 || !awesome) { - p[0] = (unsigned char)wc; - return 1; - } else if (size >= 2) { - p[0] = 0xc0; - p[1] = 0x80 | (unsigned char)wc; - return 2; - } - } - unsigned ax; - asm("call\ttpencode" - : "=a"(ax), "=m"(*(char(*)[size])s) - : "D"(s), "S"(size), "d"(wc) - : "cc"); - return ax; -} -forceinline int __tpdecode(const char *s, wint_t *out) { - if (0 <= *s && *s <= 0x7f) { - *out = *s; - return 1; - } - int ax; - asm("call\ttpdecode" - : "=a"(ax), "=m"(*(char(*)[6])s) - : "D"(s), "S"(out) - : "cc"); - return ax; -} forceinline int __pututf16(char16_t *s, size_t size, wint_t wc, bool32 awesome) { if (size >= 1 && (0x00 <= wc && wc <= 0xD7FF)) { diff --git a/libc/str/strcmp8to16i.h b/libc/str/strcmp8to16i.h index 279910ab..3f158fc8 100644 --- a/libc/str/strcmp8to16i.h +++ b/libc/str/strcmp8to16i.h @@ -2,6 +2,7 @@ #define COSMOPOLITAN_LIBC_STR_STRCMP8TO16I_H_ #include "libc/conv/conv.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ diff --git a/libc/str/tpdecode.h b/libc/str/tpdecode.h new file mode 100644 index 00000000..bbeff3a5 --- /dev/null +++ b/libc/str/tpdecode.h @@ -0,0 +1,26 @@ +#ifndef COSMOPOLITAN_LIBC_STR_TPDECODE_H_ +#define COSMOPOLITAN_LIBC_STR_TPDECODE_H_ +#if !(__ASSEMBLER__ + __LINKER__ + 0) +COSMOPOLITAN_C_START_ + +int tpdecode(const char *, wint_t *) paramsnonnull((1)) libcesque; + +#ifndef __STRICT_ANSI__ +#define tpdecode(S, OUT) __tpdecode(S, OUT) +forceinline int __tpdecode(const char *s, wint_t *out) { + if (0 <= *s && *s <= 0x7f) { + *out = *s; + return 1; + } + int ax; + asm("call\ttpdecode" + : "=a"(ax), "=m"(*(char(*)[6])s) + : "D"(s), "S"(out) + : "cc"); + return ax; +} +#endif + +COSMOPOLITAN_C_END_ +#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ +#endif /* COSMOPOLITAN_LIBC_STR_TPDECODE_H_ */ diff --git a/libc/str/tpdecode.ncabi.c b/libc/str/tpdecode.ncabi.c index ab5a3d0c..ea8fd7df 100644 --- a/libc/str/tpdecode.ncabi.c +++ b/libc/str/tpdecode.ncabi.c @@ -19,6 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/errno.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" #include "libc/str/tpdecodecb.h" forceinline int getbyte(void *arg, uint32_t i) { diff --git a/libc/str/tpenc.S b/libc/str/tpenc.S index 0bfc5c7c..414e12cd 100644 --- a/libc/str/tpenc.S +++ b/libc/str/tpenc.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Encodes Thompson-Pike varint. / diff --git a/libc/str/tpenc.h b/libc/str/tpenc.h index 5fd0a220..9cc5d26a 100644 --- a/libc/str/tpenc.h +++ b/libc/str/tpenc.h @@ -4,19 +4,20 @@ COSMOPOLITAN_C_START_ uint64_t tpenc(int32_t) pureconst; -uint64_t tpenc2(int32_t) pureconst; -#define tpenc(CODE) \ - ({ \ - unsigned long Buf; \ - int Di, Code = (CODE); \ - if (0 <= Code && Code <= 127) { \ - Buf = Code; \ - } else { \ - asm("call\ttpenc" : "=a"(Buf), "=D"(Di) : "1"(CODE) : "cc"); \ - } \ - Buf; \ +#ifndef __STRICT_ANSI__ +#define tpenc(CODE) \ + ({ \ + long Buf; \ + int32_t Code = (CODE); \ + if (0 <= Code && Code <= 127) { \ + Buf = Code; \ + } else { \ + asm("call\ttpenc" : "=a"(Buf), "+D"(Code) : /* inputs */ : "cc"); \ + } \ + Buf; \ }) +#endif COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ diff --git a/libc/str/tpencode.h b/libc/str/tpencode.h new file mode 100644 index 00000000..32550739 --- /dev/null +++ b/libc/str/tpencode.h @@ -0,0 +1,29 @@ +#ifndef COSMOPOLITAN_LIBC_STR_TPENCODE_H_ +#define COSMOPOLITAN_LIBC_STR_TPENCODE_H_ +#if !(__ASSEMBLER__ + __LINKER__ + 0) +COSMOPOLITAN_C_START_ + +unsigned tpencode(char *, size_t, wint_t, bool32) paramsnonnull() libcesque; + +#ifndef __STRICT_ANSI__ +#define tpencode(...) __tpencode(__VA_ARGS__) +forceinline unsigned __tpencode(char *p, size_t size, wint_t wc, + bool32 awesome) { + if (size >= 1 && (0x00 <= wc && wc <= 0x7f)) { + if (wc >= 32 || !awesome) { + p[0] = wc; + return 1; + } else if (size >= 2) { + p[0] = 0xc0; + p[1] = 0x80; + p[1] |= wc; + return 2; + } + } + return (tpencode)(p, size, wc, awesome); +} +#endif + +COSMOPOLITAN_C_END_ +#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ +#endif /* COSMOPOLITAN_LIBC_STR_TPENCODE_H_ */ diff --git a/libc/str/tpencode.ncabi.c b/libc/str/tpencode.ncabi.c index 6d236dc4..30a7772a 100644 --- a/libc/str/tpencode.ncabi.c +++ b/libc/str/tpencode.ncabi.c @@ -18,7 +18,8 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/str/internal.h" -#include "libc/str/str.h" +#include "libc/str/tpenc.h" +#include "libc/str/tpencode.h" /** * Thompson-Pike Varint Encoder. @@ -27,29 +28,27 @@ * is only called for non-ASCII, or DCE'd entirely. In addition to that * this function makes a promise to not clobber any registers but %rax. * - * @param buf is what ch gets encoded to + * @param p is what ch gets encoded to * @param size is the number of bytes available in buf * @param ch is a 32-bit integer * @param awesome mode enables numbers the IETF unilaterally banned * @return number of bytes written * @note this encoding was designed on a napkin in a new jersey diner */ -unsigned(tpencode)(char *buf, size_t size, wint_t ch, bool32 awesome) { - unsigned char *p = (unsigned char *)buf; - if ((0 <= ch && ch < 32) && awesome && size >= 2) { +unsigned(tpencode)(char *p, size_t size, wint_t wc, bool32 awesome) { + int i, j; + unsigned long w; + if ((0 <= wc && wc < 32) && awesome && size >= 2) { p[0] = 0xc0; - p[1] = 0x80 | (unsigned char)ch; + p[1] = 0x80; + p[1] |= wc; return 2; } - struct TpEncode op = UseTpDecoderRing(ch); - size_t i = op.len; - if (op.len <= size) { - for (;;) { - p[--i] = (unsigned char)(0b10000000 | (ch & 0b00111111)); - if (!i) break; - ch >>= 6; - } - p[0] = op.mark | (unsigned char)ch; - } - return op.len; + i = 0; + w = tpenc(wc); + do { + if (!size--) break; + p[i++] = w & 0xff; + } while (w >>= 8); + return i; } diff --git a/libc/str/tprecode16to8.c b/libc/str/tprecode16to8.c index a1380af4..30070a56 100644 --- a/libc/str/tprecode16to8.c +++ b/libc/str/tprecode16to8.c @@ -19,6 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/conv/conv.h" #include "libc/str/str.h" +#include "libc/str/tpencode.h" /** * Transcodes UTF-16 to UTF-8. diff --git a/libc/str/tprecode8to16.c b/libc/str/tprecode8to16.c index 99406568..3418898f 100644 --- a/libc/str/tprecode8to16.c +++ b/libc/str/tprecode8to16.c @@ -19,6 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/conv/conv.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" /** * Transcodes UTF-8 to UTF-16. diff --git a/libc/str/wcrtomb.c b/libc/str/wcrtomb.c index 564ef267..733bb503 100644 --- a/libc/str/wcrtomb.c +++ b/libc/str/wcrtomb.c @@ -19,6 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/limits.h" #include "libc/str/str.h" +#include "libc/str/tpencode.h" size_t wcrtomb(char *s, wchar_t wc, mbstate_t *st) { if (!s) return 1; diff --git a/libc/str/wcsrtombs.c b/libc/str/wcsrtombs.c index 1f256e76..fc17c9f0 100644 --- a/libc/str/wcsrtombs.c +++ b/libc/str/wcsrtombs.c @@ -19,10 +19,13 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/conv/conv.h" #include "libc/str/str.h" +#include "libc/str/tpencode.h" size_t wcsrtombs(char *dest, const wchar_t **src, size_t len, mbstate_t *ps) { - /* TODO(jart): broken broken broken insane api */ - size_t i = 0; + /* TODO(jart): broken */ + int64_t word; + size_t i, got; + i = 0; if (len) { for (;;) { if (!**src || len == 1) { diff --git a/libc/str/wctomb.c b/libc/str/wctomb.c index 2cb8d1fd..d46d6a43 100644 --- a/libc/str/wctomb.c +++ b/libc/str/wctomb.c @@ -19,6 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/limits.h" #include "libc/str/str.h" +#include "libc/str/tpencode.h" int wctomb(char *s, wchar_t wc) { if (!s) return 0; diff --git a/libc/stubs/abort.S b/libc/stubs/abort.S index 6f186435..b37e1d33 100644 --- a/libc/stubs/abort.S +++ b/libc/stubs/abort.S @@ -19,6 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/macros.h" .real +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 / Most basic tier of program self-termination. @@ -29,4 +30,3 @@ abort: push %bp rlcall panic int3 .endfn abort,weak,protected - .yoink __FILE__ diff --git a/libc/stubs/addvdi3.S b/libc/stubs/addvdi3.S index d36f369d..054c28f8 100644 --- a/libc/stubs/addvdi3.S +++ b/libc/stubs/addvdi3.S @@ -20,6 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely +.source __FILE__ / Returns 𝑥+𝑦, aborting on overflow. / @@ -38,4 +39,3 @@ __addvdi3: pop %rbp ret .endfn __addvdi3,globl - .yoink __FILE__ diff --git a/libc/stubs/addvsi3.S b/libc/stubs/addvsi3.S index 1a639e8a..018c4f27 100644 --- a/libc/stubs/addvsi3.S +++ b/libc/stubs/addvsi3.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns 𝑥+𝑦, aborting on overflow. / diff --git a/libc/stubs/addvti3.S b/libc/stubs/addvti3.S index 474d234e..87717766 100644 --- a/libc/stubs/addvti3.S +++ b/libc/stubs/addvti3.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns 𝑥+𝑦, aborting on overflow. / diff --git a/libc/stubs/asan.greg.S b/libc/stubs/asan.greg.S index 904bcde8..386ffffc 100644 --- a/libc/stubs/asan.greg.S +++ b/libc/stubs/asan.greg.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ __asan_addr_is_in_fake_stack: __asan_alloca_poison: diff --git a/libc/stubs/asanjmp.greg.S b/libc/stubs/asanjmp.greg.S index e4de81ef..9f86c982 100644 --- a/libc/stubs/asanjmp.greg.S +++ b/libc/stubs/asanjmp.greg.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .privileged -.yoink __FILE__ +.source __FILE__ __asan_load1: push $1 diff --git a/libc/stubs/assertfail.S b/libc/stubs/assertfail.S index 1fe7fc34..b9edea96 100644 --- a/libc/stubs/assertfail.S +++ b/libc/stubs/assertfail.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/macros.h" .real -.yoink __FILE__ +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 / Lightweight universal overridable assert() macro support. diff --git a/libc/stubs/cxapurevirtual.S b/libc/stubs/cxapurevirtual.S index 50441671..fd939fea 100644 --- a/libc/stubs/cxapurevirtual.S +++ b/libc/stubs/cxapurevirtual.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Did you call a virtual method from a destructor? __cxa_pure_virtual: diff --git a/libc/stubs/debugbreak.S b/libc/stubs/debugbreak.S index 0ef274fb..f27dec5b 100644 --- a/libc/stubs/debugbreak.S +++ b/libc/stubs/debugbreak.S @@ -17,9 +17,9 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" +#include "libc/macros.h" .real -.yoink __FILE__ +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 / Triggers breakpoint in software debugger. diff --git a/libc/stubs/errno.S b/libc/stubs/errno.S index 7d868e43..333559ca 100644 --- a/libc/stubs/errno.S +++ b/libc/stubs/errno.S @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" -.yoink __FILE__ +#include "libc/macros.h" +.source __FILE__ / Global variable for last error. / diff --git a/libc/stubs/errnolocation.S b/libc/stubs/errnolocation.S index db89a061..b224164c 100644 --- a/libc/stubs/errnolocation.S +++ b/libc/stubs/errnolocation.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .keep.text # gdb needs it / Returns address of errno variable. diff --git a/libc/stubs/exit.S b/libc/stubs/exit.S index 96b6fa24..afb4a5de 100644 --- a/libc/stubs/exit.S +++ b/libc/stubs/exit.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/macros.h" .real -.yoink __FILE__ +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 / Linkable delegate for traditional Unix user process termination. diff --git a/libc/stubs/exit11.S b/libc/stubs/exit11.S index 0092a31e..15b54720 100644 --- a/libc/stubs/exit11.S +++ b/libc/stubs/exit11.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/macros.h" .real -.yoink __FILE__ +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 / Thrice re-imagined Unix user process termination API stub. diff --git a/libc/stubs/fentry.S b/libc/stubs/fentry.S index 0a859055..b396e0ff 100644 --- a/libc/stubs/fentry.S +++ b/libc/stubs/fentry.S @@ -17,9 +17,9 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" +#include "libc/macros.h" .real -.yoink __FILE__ +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 / Function entry hook stub. diff --git a/libc/stubs/gcov.S b/libc/stubs/gcov.S index 6091fb40..4046c3a8 100644 --- a/libc/stubs/gcov.S +++ b/libc/stubs/gcov.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Magic words to unbreak build if GCOV flags are passed. diff --git a/libc/stubs/instrumentation.S b/libc/stubs/instrumentation.S index 1b4edae2..10610731 100644 --- a/libc/stubs/instrumentation.S +++ b/libc/stubs/instrumentation.S @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" -.yoink __FILE__ +#include "libc/macros.h" +.source __FILE__ / @fileoverview Function Instrumentation No-Op Runtime / diff --git a/libc/stubs/mcount.S b/libc/stubs/mcount.S index cf78a45a..80d4412f 100644 --- a/libc/stubs/mcount.S +++ b/libc/stubs/mcount.S @@ -17,9 +17,9 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" +#include "libc/macros.h" .real -.yoink __FILE__ +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 / Function Profiling Hook. diff --git a/libc/stubs/missingno.S b/libc/stubs/missingno.S index b9ef3bd7..c6d0db80 100644 --- a/libc/stubs/missingno.S +++ b/libc/stubs/missingno.S @@ -17,9 +17,9 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" +#include "libc/macros.h" .real -.yoink __FILE__ +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 / Optional function stub. diff --git a/libc/stubs/mulvdi3.S b/libc/stubs/mulvdi3.S index f7f3e791..0b973948 100644 --- a/libc/stubs/mulvdi3.S +++ b/libc/stubs/mulvdi3.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns 𝑥*𝑦, aborting on overflow. / diff --git a/libc/stubs/mulvsi3.S b/libc/stubs/mulvsi3.S index bb0f9937..8d4d046b 100644 --- a/libc/stubs/mulvsi3.S +++ b/libc/stubs/mulvsi3.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns 𝑥*𝑦, aborting on overflow. / diff --git a/libc/stubs/mulvti3.S b/libc/stubs/mulvti3.S index 7c68a5b3..e696644d 100644 --- a/libc/stubs/mulvti3.S +++ b/libc/stubs/mulvti3.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns 𝑥*𝑦, aborting on overflow. / diff --git a/libc/stubs/negvdi2.S b/libc/stubs/negvdi2.S index 8e5220c1..d005f673 100644 --- a/libc/stubs/negvdi2.S +++ b/libc/stubs/negvdi2.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns -𝑥, aborting on overflow (two's complement bane). / diff --git a/libc/stubs/negvsi2.S b/libc/stubs/negvsi2.S index 41432eeb..314edd62 100644 --- a/libc/stubs/negvsi2.S +++ b/libc/stubs/negvsi2.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns -𝑥, aborting on overflow (two's complement bane). / diff --git a/libc/stubs/negvti2.S b/libc/stubs/negvti2.S index 5f58fa4a..1a97399f 100644 --- a/libc/stubs/negvti2.S +++ b/libc/stubs/negvti2.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns -𝑥, aborting on overflow. / diff --git a/libc/stubs/onarithmeticoverflow.S b/libc/stubs/onarithmeticoverflow.S index d304d2fc..445c4399 100644 --- a/libc/stubs/onarithmeticoverflow.S +++ b/libc/stubs/onarithmeticoverflow.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" .text.unlikely -.yoink __FILE__ +.source __FILE__ / Arithmetic overflow handler. / diff --git a/libc/stubs/panic.S b/libc/stubs/panic.S index b29a5f6e..2b7926f5 100644 --- a/libc/stubs/panic.S +++ b/libc/stubs/panic.S @@ -17,9 +17,9 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" +#include "libc/macros.h" .real -.yoink __FILE__ +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 / Aborts or hard blocks instruction pointer. diff --git a/libc/stubs/stackguard.S b/libc/stubs/stackguard.S index 4f2d6825..c25821cd 100644 --- a/libc/stubs/stackguard.S +++ b/libc/stubs/stackguard.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/macros.h" .real -.yoink __FILE__ +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 /** diff --git a/libc/stubs/subvdi3.S b/libc/stubs/subvdi3.S index 10deb8e3..9cab8698 100644 --- a/libc/stubs/subvdi3.S +++ b/libc/stubs/subvdi3.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns 𝑥-𝑦, aborting on overflow. / diff --git a/libc/stubs/subvsi3.S b/libc/stubs/subvsi3.S index b0e463b8..bc9eb661 100644 --- a/libc/stubs/subvsi3.S +++ b/libc/stubs/subvsi3.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns 𝑥-𝑦, aborting on overflow. / diff --git a/libc/stubs/subvti3.S b/libc/stubs/subvti3.S index ef8276a6..f118ece0 100644 --- a/libc/stubs/subvti3.S +++ b/libc/stubs/subvti3.S @@ -20,7 +20,7 @@ #include "libc/macros.h" .align 16 .text.likely -.yoink __FILE__ +.source __FILE__ / Returns 𝑥-𝑦, aborting on overflow. / diff --git a/libc/stubs/triplf.S b/libc/stubs/triplf.S index 2cf883a1..d1751e16 100644 --- a/libc/stubs/triplf.S +++ b/libc/stubs/triplf.S @@ -20,7 +20,7 @@ #include "ape/macros.h" #include "ape/config.h" .real -.yoink __FILE__ +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 / Hoses interrupt descriptor table and triple-faults the system. diff --git a/libc/stubs/typeinfo.S b/libc/stubs/typeinfo.S index e5a84d48..fca4a26b 100644 --- a/libc/stubs/typeinfo.S +++ b/libc/stubs/typeinfo.S @@ -18,6 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" +.source __FILE__ / __cxxabiv1::__function_type_info (?) / Because Clang in MODE=dbg doesn't respect -fno-rtti @@ -25,4 +26,3 @@ _ZTVN10__cxxabiv120__function_type_infoE: .quad 0 .endobj _ZTVN10__cxxabiv120__function_type_infoE,globl - .yoink __FILE__ diff --git a/libc/stubs/ubsan.S b/libc/stubs/ubsan.S index 34afbbaa..e24b8e8d 100644 --- a/libc/stubs/ubsan.S +++ b/libc/stubs/ubsan.S @@ -20,7 +20,7 @@ #include "ape/macros.h" .real .code16 # ∩ .code32 ∩ .code64 -.yoink __FILE__ +.source __FILE__ /** * @fileoverview Overridable stubs for synthetic sanitizer calls. diff --git a/libc/stubs/unprovable.S b/libc/stubs/unprovable.S index 2495bc52..af31f30a 100644 --- a/libc/stubs/unprovable.S +++ b/libc/stubs/unprovable.S @@ -17,8 +17,9 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" +#include "libc/macros.h" .real +.source __FILE__ .code16 # ∩ .code32 ∩ .code64 __unprovable: @@ -28,4 +29,3 @@ __unprovable: pop %bp ret .endfn __unprovable,globl,hidden - .yoink __FILE__ diff --git a/libc/stubs/xnu.S b/libc/stubs/xnu.S index 2359180a..aad09c33 100644 --- a/libc/stubs/xnu.S +++ b/libc/stubs/xnu.S @@ -18,8 +18,8 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" +.source __FILE__ _start_xnu: jmp abort .endfn _start_xnu,weak - .yoink __FILE__ diff --git a/libc/sysv/g_syscount.S b/libc/sysv/g_syscount.S index ea0db96b..55a66716 100644 --- a/libc/sysv/g_syscount.S +++ b/libc/sysv/g_syscount.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / RII System Five system call counter. / diff --git a/libc/sysv/restorert.S b/libc/sysv/restorert.S index 8af49144..cfd558ce 100644 --- a/libc/sysv/restorert.S +++ b/libc/sysv/restorert.S @@ -17,7 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" +#include "libc/macros.h" +.source __FILE__ / Linux Signal Trampoline (HOLY CODE) .align 16 @@ -26,4 +27,3 @@ __restore_rt: # @see gdb/amd64-linux-tdep.c syscall .align 16 .endfn __restore_rt,globl,hidden - .yoink __FILE__ diff --git a/libc/sysv/stackchkguard.S b/libc/sysv/stackchkguard.S index 49b25468..ce60faa3 100644 --- a/libc/sysv/stackchkguard.S +++ b/libc/sysv/stackchkguard.S @@ -20,7 +20,7 @@ #include "libc/macros.h" #include "libc/notice.inc" #include "libc/sysv/consts/auxv.h" -.yoink __FILE__ +.source __FILE__ / Canary for -fstack-protector. / diff --git a/libc/sysv/syscall.S b/libc/sysv/syscall.S index 7a6bf912..a924a474 100644 --- a/libc/sysv/syscall.S +++ b/libc/sysv/syscall.S @@ -41,4 +41,4 @@ syscall:mov %rdi,%rax mov 8(%rsp),%r9 jmp *systemfive(%rip) .endfn syscall,globl - .yoink __FILE__ + .source __FILE__ diff --git a/libc/sysv/systemfive.S b/libc/sysv/systemfive.S index ae4dfec5..9b2601c6 100644 --- a/libc/sysv/systemfive.S +++ b/libc/sysv/systemfive.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dce.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ /* ▄▄▄ ▄▄▄ ▀▓▓▒▄ diff --git a/libc/testlib/bench.S b/libc/testlib/bench.S index 5ab5c1a4..d8f6d19b 100644 --- a/libc/testlib/bench.S +++ b/libc/testlib/bench.S @@ -18,9 +18,8 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" - - yoink __FILE__ - yoink testlib_runallbenchmarks +.yoink testlib_runallbenchmarks +.source __FILE__ / Decentralized section for benchmark registration. / diff --git a/libc/testlib/combo.S b/libc/testlib/combo.S index dd93dbae..e62ffcae 100644 --- a/libc/testlib/combo.S +++ b/libc/testlib/combo.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Decentralized section for test combo registration. / diff --git a/libc/testlib/fixture.S b/libc/testlib/fixture.S index cf5ac3dd..df4d9748 100644 --- a/libc/testlib/fixture.S +++ b/libc/testlib/fixture.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Decentralized section for test fixture registration. / diff --git a/libc/testlib/hyperion.S b/libc/testlib/hyperion.S index 29769a20..a4a8c56d 100644 --- a/libc/testlib/hyperion.S +++ b/libc/testlib/hyperion.S @@ -18,8 +18,8 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" +.source __FILE__ .rodata -.yoink __FILE__ / Nontrivial NUL-terminated string test vector. .align 1 diff --git a/libc/testlib/testcase.S b/libc/testlib/testcase.S index 8cdd1757..1436577c 100644 --- a/libc/testlib/testcase.S +++ b/libc/testlib/testcase.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Decentralized section for test testcase registration. / diff --git a/libc/testlib/thrashcodecache.S b/libc/testlib/thrashcodecache.S index 4d9d7243..cfed5d56 100644 --- a/libc/testlib/thrashcodecache.S +++ b/libc/testlib/thrashcodecache.S @@ -18,8 +18,8 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" +.source __FILE__ .testonly -.yoink __FILE__ / Empties L1 instruction cache. thrashcodecache: diff --git a/libc/testlib/thunks/assert_eq.S b/libc/testlib/thunks/assert_eq.S index 6d38bcd7..e683e080 100644 --- a/libc/testlib/thunks/assert_eq.S +++ b/libc/testlib/thunks/assert_eq.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .text.unlikely testlib_showerror_assert_eq: diff --git a/libc/testlib/thunks/assert_false.S b/libc/testlib/thunks/assert_false.S index 64a8c087..0497414c 100644 --- a/libc/testlib/thunks/assert_false.S +++ b/libc/testlib/thunks/assert_false.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .text.unlikely testlib_showerror_assert_false: diff --git a/libc/testlib/thunks/assert_ne.S b/libc/testlib/thunks/assert_ne.S index 498974a5..fe45d650 100644 --- a/libc/testlib/thunks/assert_ne.S +++ b/libc/testlib/thunks/assert_ne.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .text.unlikely testlib_showerror_assert_ne: diff --git a/libc/testlib/thunks/assert_true.S b/libc/testlib/thunks/assert_true.S index ed9f3166..c04f5f4a 100644 --- a/libc/testlib/thunks/assert_true.S +++ b/libc/testlib/thunks/assert_true.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .text.unlikely testlib_showerror_assert_true: diff --git a/libc/testlib/thunks/expect_eq.S b/libc/testlib/thunks/expect_eq.S index 3310dccf..bafb1e1b 100644 --- a/libc/testlib/thunks/expect_eq.S +++ b/libc/testlib/thunks/expect_eq.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .text.unlikely testlib_showerror_expect_eq: diff --git a/libc/testlib/thunks/expect_false.S b/libc/testlib/thunks/expect_false.S index 164a6d74..63705baa 100644 --- a/libc/testlib/thunks/expect_false.S +++ b/libc/testlib/thunks/expect_false.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .text.unlikely testlib_showerror_expect_false: diff --git a/libc/testlib/thunks/expect_ne.S b/libc/testlib/thunks/expect_ne.S index c8b3aff2..3ce1049f 100644 --- a/libc/testlib/thunks/expect_ne.S +++ b/libc/testlib/thunks/expect_ne.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .text.unlikely testlib_showerror_expect_ne: diff --git a/libc/testlib/thunks/expect_true.S b/libc/testlib/thunks/expect_true.S index fd381443..df71d2b8 100644 --- a/libc/testlib/thunks/expect_true.S +++ b/libc/testlib/thunks/expect_true.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .text.unlikely testlib_showerror_expect_true: diff --git a/libc/testlib/thunks/free.S b/libc/testlib/thunks/free.S index 9f936156..0d449f6f 100644 --- a/libc/testlib/thunks/free.S +++ b/libc/testlib/thunks/free.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Delegates to free(). / diff --git a/libc/testlib/thunks/jump.S b/libc/testlib/thunks/jump.S index 85ad39c8..31213aa8 100644 --- a/libc/testlib/thunks/jump.S +++ b/libc/testlib/thunks/jump.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ .text.unlikely testlib_showerror_jump: diff --git a/libc/time/kmonthname.S b/libc/time/kmonthname.S index 8d538103..d12c22ff 100644 --- a/libc/time/kmonthname.S +++ b/libc/time/kmonthname.S @@ -7,7 +7,7 @@ │ • http://creativecommons.org/publicdomain/zero/1.0/ │ ╚─────────────────────────────────────────────────────────────────*/ #endif -#include "libc/macros.inc" +#include "libc/macros.h" / extern const char kMonthName[12][10]; .section .rodata,"aS",@progbits diff --git a/libc/time/kmonthnameshort.S b/libc/time/kmonthnameshort.S index 3a90b2ae..d0e1e78c 100644 --- a/libc/time/kmonthnameshort.S +++ b/libc/time/kmonthnameshort.S @@ -7,7 +7,7 @@ │ • http://creativecommons.org/publicdomain/zero/1.0/ │ ╚─────────────────────────────────────────────────────────────────*/ #endif -#include "libc/macros.inc" +#include "libc/macros.h" / Type #1: / - Indexable C-String Array diff --git a/libc/time/kweekdayname.S b/libc/time/kweekdayname.S index b3c552fa..2102d94d 100644 --- a/libc/time/kweekdayname.S +++ b/libc/time/kweekdayname.S @@ -7,7 +7,7 @@ │ • http://creativecommons.org/publicdomain/zero/1.0/ │ ╚─────────────────────────────────────────────────────────────────*/ #endif -#include "libc/macros.inc" +#include "libc/macros.h" / extern const char kWeekdayName[7][10]; .section .rodata,"aS",@progbits diff --git a/libc/time/kweekdaynameshort.S b/libc/time/kweekdaynameshort.S index 4ac02d26..f032e478 100644 --- a/libc/time/kweekdaynameshort.S +++ b/libc/time/kweekdaynameshort.S @@ -7,7 +7,7 @@ │ • http://creativecommons.org/publicdomain/zero/1.0/ │ ╚─────────────────────────────────────────────────────────────────*/ #endif -#include "libc/macros.inc" +#include "libc/macros.h" / Type #1: / - Indexable C-String Array diff --git a/libc/tinymath/acos.S b/libc/tinymath/acos.S index 82595d03..58c98b05 100644 --- a/libc/tinymath/acos.S +++ b/libc/tinymath/acos.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc cosine of 𝑥. / diff --git a/libc/tinymath/acosf.S b/libc/tinymath/acosf.S index fd07a9ab..1270059b 100644 --- a/libc/tinymath/acosf.S +++ b/libc/tinymath/acosf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc cosine of 𝑥. / diff --git a/libc/tinymath/acosl.S b/libc/tinymath/acosl.S index 278cd0da..41984e5a 100644 --- a/libc/tinymath/acosl.S +++ b/libc/tinymath/acosl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc cosine of 𝑥. / diff --git a/libc/tinymath/asin.S b/libc/tinymath/asin.S index faac9db0..33b3c15b 100644 --- a/libc/tinymath/asin.S +++ b/libc/tinymath/asin.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc sine of 𝑥. / diff --git a/libc/tinymath/asinf.S b/libc/tinymath/asinf.S index a830de13..42b5d021 100644 --- a/libc/tinymath/asinf.S +++ b/libc/tinymath/asinf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc sine of 𝑥. / diff --git a/libc/tinymath/asinl.S b/libc/tinymath/asinl.S index 80a8c467..14cd0d03 100644 --- a/libc/tinymath/asinl.S +++ b/libc/tinymath/asinl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc sine of 𝑥. / diff --git a/libc/tinymath/atan.S b/libc/tinymath/atan.S index c15ab5db..42cc037c 100644 --- a/libc/tinymath/atan.S +++ b/libc/tinymath/atan.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc tangent of 𝑥. / diff --git a/libc/tinymath/atan2.S b/libc/tinymath/atan2.S index 3e284324..8e651117 100644 --- a/libc/tinymath/atan2.S +++ b/libc/tinymath/atan2.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc tangent of 𝑦/𝑥. / diff --git a/libc/tinymath/atan2f.S b/libc/tinymath/atan2f.S index 3fa51e83..287a1a7b 100644 --- a/libc/tinymath/atan2f.S +++ b/libc/tinymath/atan2f.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc tangent of 𝑦/𝑥. / diff --git a/libc/tinymath/atan2l.S b/libc/tinymath/atan2l.S index 0fcb6721..59a09e99 100644 --- a/libc/tinymath/atan2l.S +++ b/libc/tinymath/atan2l.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc tangent of 𝑦/𝑥. / diff --git a/libc/tinymath/atanf.S b/libc/tinymath/atanf.S index 9462c65f..4faf8ba2 100644 --- a/libc/tinymath/atanf.S +++ b/libc/tinymath/atanf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc tangent of 𝑥. / diff --git a/libc/tinymath/atanl.S b/libc/tinymath/atanl.S index ce7162c5..796915de 100644 --- a/libc/tinymath/atanl.S +++ b/libc/tinymath/atanl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns arc tangent of 𝑥. / diff --git a/libc/tinymath/c2rangr.S b/libc/tinymath/c2rangr.S index 0c1457fa..8c0cbff1 100644 --- a/libc/tinymath/c2rangr.S +++ b/libc/tinymath/c2rangr.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/lib/pc.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Computes transcedental trigonometry op w/ reactive scaling. / diff --git a/libc/tinymath/cabs.S b/libc/tinymath/cabs.S index 362913f8..45684222 100644 --- a/libc/tinymath/cabs.S +++ b/libc/tinymath/cabs.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns absolute value of complex number. tinymath_cabs: diff --git a/libc/tinymath/cabsf.S b/libc/tinymath/cabsf.S index e19f4ba6..9b6e5d9f 100644 --- a/libc/tinymath/cabsf.S +++ b/libc/tinymath/cabsf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_cabsf: push %rbp diff --git a/libc/tinymath/cabsl.S b/libc/tinymath/cabsl.S index e8a955a8..238e912e 100644 --- a/libc/tinymath/cabsl.S +++ b/libc/tinymath/cabsl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_cabsl: push %rbp diff --git a/libc/tinymath/carg.S b/libc/tinymath/carg.S index 810a09db..004f3643 100644 --- a/libc/tinymath/carg.S +++ b/libc/tinymath/carg.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_carg: push %rbp diff --git a/libc/tinymath/cargf.S b/libc/tinymath/cargf.S index d9316a1f..78e2db40 100644 --- a/libc/tinymath/cargf.S +++ b/libc/tinymath/cargf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_cargf: push %rbp diff --git a/libc/tinymath/cargl.S b/libc/tinymath/cargl.S index 5aece592..3db2b47d 100644 --- a/libc/tinymath/cargl.S +++ b/libc/tinymath/cargl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_cargl: push %rbp diff --git a/libc/tinymath/ceil.S b/libc/tinymath/ceil.S index 4c45e899..0e557220 100644 --- a/libc/tinymath/ceil.S +++ b/libc/tinymath/ceil.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_ceil: .leafprologue diff --git a/libc/tinymath/ceilf.S b/libc/tinymath/ceilf.S index ec788f42..83c9ce51 100644 --- a/libc/tinymath/ceilf.S +++ b/libc/tinymath/ceilf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_ceilf: .leafprologue diff --git a/libc/tinymath/ceill.S b/libc/tinymath/ceill.S index 8f91e64c..59d6b174 100644 --- a/libc/tinymath/ceill.S +++ b/libc/tinymath/ceill.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_ceill: .profilable diff --git a/libc/tinymath/cimag.S b/libc/tinymath/cimag.S index 1bed8e4a..770e0e93 100644 --- a/libc/tinymath/cimag.S +++ b/libc/tinymath/cimag.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ cimag: .leafprologue .profilable diff --git a/libc/tinymath/cimagf.S b/libc/tinymath/cimagf.S index 8b72c136..6d314fd7 100644 --- a/libc/tinymath/cimagf.S +++ b/libc/tinymath/cimagf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ cimagf: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/cimagl.S b/libc/tinymath/cimagl.S index 29d19ad6..b8855a1e 100644 --- a/libc/tinymath/cimagl.S +++ b/libc/tinymath/cimagl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ cimagl: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/conj.S b/libc/tinymath/conj.S index 303d1ee7..cbb1239a 100644 --- a/libc/tinymath/conj.S +++ b/libc/tinymath/conj.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_conj: .leafprologue diff --git a/libc/tinymath/conjf.S b/libc/tinymath/conjf.S index 71e21d1f..fd1b5961 100644 --- a/libc/tinymath/conjf.S +++ b/libc/tinymath/conjf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_conjf: .profilable diff --git a/libc/tinymath/conjl.S b/libc/tinymath/conjl.S index 53bc135c..4dac289b 100644 --- a/libc/tinymath/conjl.S +++ b/libc/tinymath/conjl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_conjl: .profilable diff --git a/libc/tinymath/copysign.S b/libc/tinymath/copysign.S index 2c1dd279..504c51b3 100644 --- a/libc/tinymath/copysign.S +++ b/libc/tinymath/copysign.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_copysign: .leafprologue diff --git a/libc/tinymath/copysignf.S b/libc/tinymath/copysignf.S index f8368350..6325c8c7 100644 --- a/libc/tinymath/copysignf.S +++ b/libc/tinymath/copysignf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_copysignf: .leafprologue diff --git a/libc/tinymath/copysignl.S b/libc/tinymath/copysignl.S index c55c4671..c98667a9 100644 --- a/libc/tinymath/copysignl.S +++ b/libc/tinymath/copysignl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_copysignl: push %rbp diff --git a/libc/tinymath/cos.S b/libc/tinymath/cos.S index 5558c006..8ecb28f5 100644 --- a/libc/tinymath/cos.S +++ b/libc/tinymath/cos.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns cosine of 𝑥. / diff --git a/libc/tinymath/cosf.S b/libc/tinymath/cosf.S index 608ca242..664c26dc 100644 --- a/libc/tinymath/cosf.S +++ b/libc/tinymath/cosf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns cosine of 𝑥. / diff --git a/libc/tinymath/cosl.S b/libc/tinymath/cosl.S index 76ea93f4..3988a0b5 100644 --- a/libc/tinymath/cosl.S +++ b/libc/tinymath/cosl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns cosine of 𝑥. / diff --git a/libc/tinymath/cprojf.S b/libc/tinymath/cprojf.S index ae23a932..398b97fa 100644 --- a/libc/tinymath/cprojf.S +++ b/libc/tinymath/cprojf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_cprojf: push %rbp diff --git a/libc/tinymath/cprojl.S b/libc/tinymath/cprojl.S index fd7e2c7f..79214c75 100644 --- a/libc/tinymath/cprojl.S +++ b/libc/tinymath/cprojl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_cprojl: .profilable diff --git a/libc/tinymath/creal.S b/libc/tinymath/creal.S index b72e8555..9f1ee33b 100644 --- a/libc/tinymath/creal.S +++ b/libc/tinymath/creal.S @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" -.yoink __FILE__ +#include "libc/macros.h" +.source __FILE__ creal: ret .endfn creal,globl diff --git a/libc/tinymath/crealf.S b/libc/tinymath/crealf.S index 18294f34..6d8db785 100644 --- a/libc/tinymath/crealf.S +++ b/libc/tinymath/crealf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ crealf: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/creall.S b/libc/tinymath/creall.S index b5f9a4b9..9dbc79e7 100644 --- a/libc/tinymath/creall.S +++ b/libc/tinymath/creall.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ creall: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/d2ld2.S b/libc/tinymath/d2ld2.S index 6cdfea06..6f76313c 100644 --- a/libc/tinymath/d2ld2.S +++ b/libc/tinymath/d2ld2.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Thunks double(*fn)(double,double) -> long double fn. / diff --git a/libc/tinymath/exp.S b/libc/tinymath/exp.S index 352d9792..8fabdcae 100644 --- a/libc/tinymath/exp.S +++ b/libc/tinymath/exp.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 𝑒^x. / diff --git a/libc/tinymath/exp10.S b/libc/tinymath/exp10.S index 08a481e7..baf48aa1 100644 --- a/libc/tinymath/exp10.S +++ b/libc/tinymath/exp10.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 10^x. / diff --git a/libc/tinymath/exp10f.S b/libc/tinymath/exp10f.S index 5b9ec34d..49834f4b 100644 --- a/libc/tinymath/exp10f.S +++ b/libc/tinymath/exp10f.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 10^x. / diff --git a/libc/tinymath/exp10l.S b/libc/tinymath/exp10l.S index d778a3d3..9eee0bba 100644 --- a/libc/tinymath/exp10l.S +++ b/libc/tinymath/exp10l.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 10^x. / diff --git a/libc/tinymath/exp2.S b/libc/tinymath/exp2.S index bbb5a7a7..531fdbc2 100644 --- a/libc/tinymath/exp2.S +++ b/libc/tinymath/exp2.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 2^𝑥. / diff --git a/libc/tinymath/exp2f.S b/libc/tinymath/exp2f.S index cc03d524..6dd188ae 100644 --- a/libc/tinymath/exp2f.S +++ b/libc/tinymath/exp2f.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ exp2f: ezlea exp2f,ax jmp _f2ld2 diff --git a/libc/tinymath/exp2l.S b/libc/tinymath/exp2l.S index 36e38c4f..ffaa2276 100644 --- a/libc/tinymath/exp2l.S +++ b/libc/tinymath/exp2l.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 2^x. exp2l: push %rbp diff --git a/libc/tinymath/expf.S b/libc/tinymath/expf.S index ea6733cd..3256f1da 100644 --- a/libc/tinymath/expf.S +++ b/libc/tinymath/expf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 𝑒^x. / diff --git a/libc/tinymath/expl.S b/libc/tinymath/expl.S index 11128ab6..30cb2e90 100644 --- a/libc/tinymath/expl.S +++ b/libc/tinymath/expl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 𝑒^x. / diff --git a/libc/tinymath/expm1.S b/libc/tinymath/expm1.S index eff736df..d41ee6a8 100644 --- a/libc/tinymath/expm1.S +++ b/libc/tinymath/expm1.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ expm1: ezlea expm1l,ax jmp _d2ld2 diff --git a/libc/tinymath/expm1f.S b/libc/tinymath/expm1f.S index 537518ff..007972d9 100644 --- a/libc/tinymath/expm1f.S +++ b/libc/tinymath/expm1f.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ expm1f: ezlea expm1l,ax jmp _f2ld2 diff --git a/libc/tinymath/expm1l.S b/libc/tinymath/expm1l.S index e7037111..21e8ecb2 100644 --- a/libc/tinymath/expm1l.S +++ b/libc/tinymath/expm1l.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns exp(𝑥) - 1. expm1l: push %rbp diff --git a/libc/tinymath/f2ld2.S b/libc/tinymath/f2ld2.S index 4bc0d631..4bf37d14 100644 --- a/libc/tinymath/f2ld2.S +++ b/libc/tinymath/f2ld2.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Thunks float(*fn)(float,float) -> long double fn. / diff --git a/libc/tinymath/fabs.S b/libc/tinymath/fabs.S index 6d01b907..58a19e30 100644 --- a/libc/tinymath/fabs.S +++ b/libc/tinymath/fabs.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fabs: .leafprologue .profilable diff --git a/libc/tinymath/fabsf.S b/libc/tinymath/fabsf.S index c2fc69f4..24f4f61a 100644 --- a/libc/tinymath/fabsf.S +++ b/libc/tinymath/fabsf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fabsf: .leafprologue .profilable diff --git a/libc/tinymath/fabsl.S b/libc/tinymath/fabsl.S index 0d49a7c6..9a27e722 100644 --- a/libc/tinymath/fabsl.S +++ b/libc/tinymath/fabsl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ fabsl: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/fld.S b/libc/tinymath/fld.S index 8fc56518..fa3f4756 100644 --- a/libc/tinymath/fld.S +++ b/libc/tinymath/fld.S @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.inc" -.yoink __FILE__ +#include "libc/macros.h" +.source __FILE__ fld1: fld1 ret diff --git a/libc/tinymath/floor.S b/libc/tinymath/floor.S index 0204de69..aac0fd83 100644 --- a/libc/tinymath/floor.S +++ b/libc/tinymath/floor.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / vroundsd $_MM_FROUND_TO_NEG_INF|_MM_FROUND_NO_EXC,%xmm0,%xmm0,%xmm0 diff --git a/libc/tinymath/floorf.S b/libc/tinymath/floorf.S index f3c07d78..4159e99b 100644 --- a/libc/tinymath/floorf.S +++ b/libc/tinymath/floorf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_floorf: .leafprologue diff --git a/libc/tinymath/floorl.S b/libc/tinymath/floorl.S index 702e4887..32dad865 100644 --- a/libc/tinymath/floorl.S +++ b/libc/tinymath/floorl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_floorl: .profilable diff --git a/libc/tinymath/fmax.S b/libc/tinymath/fmax.S index 09b701ec..205a853b 100644 --- a/libc/tinymath/fmax.S +++ b/libc/tinymath/fmax.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_fmax: .leafprologue diff --git a/libc/tinymath/fmaxf.S b/libc/tinymath/fmaxf.S index 46e79e5b..2ddb1b8b 100644 --- a/libc/tinymath/fmaxf.S +++ b/libc/tinymath/fmaxf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_fmaxf: .leafprologue diff --git a/libc/tinymath/fmaxl.S b/libc/tinymath/fmaxl.S index 5d4a1298..ecc80074 100644 --- a/libc/tinymath/fmaxl.S +++ b/libc/tinymath/fmaxl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_fmaxl: push %rbp diff --git a/libc/tinymath/fmin.S b/libc/tinymath/fmin.S index 010ba766..5c346924 100644 --- a/libc/tinymath/fmin.S +++ b/libc/tinymath/fmin.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_fmin: .leafprologue diff --git a/libc/tinymath/fminf.S b/libc/tinymath/fminf.S index aff71cbb..1030e69f 100644 --- a/libc/tinymath/fminf.S +++ b/libc/tinymath/fminf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_fminf: .leafprologue diff --git a/libc/tinymath/fminl.S b/libc/tinymath/fminl.S index f0ccb16e..c9bf8b33 100644 --- a/libc/tinymath/fminl.S +++ b/libc/tinymath/fminl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_fminl: push %rbp diff --git a/libc/tinymath/fmod.S b/libc/tinymath/fmod.S index 95da26bb..daea9df1 100644 --- a/libc/tinymath/fmod.S +++ b/libc/tinymath/fmod.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / fmod [sic] does (𝑥 rem 𝑦) w/ round()-style rounding. / diff --git a/libc/tinymath/fmodf.S b/libc/tinymath/fmodf.S index 4d374159..3146d3c3 100644 --- a/libc/tinymath/fmodf.S +++ b/libc/tinymath/fmodf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_fmodf: ezlea tinymath_fmodl,ax diff --git a/libc/tinymath/fmodl.S b/libc/tinymath/fmodl.S index 29883276..05856347 100644 --- a/libc/tinymath/fmodl.S +++ b/libc/tinymath/fmodl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_fmodl: push %rbp diff --git a/libc/tinymath/fpclassify.S b/libc/tinymath/fpclassify.S index 2a7def74..71633047 100644 --- a/libc/tinymath/fpclassify.S +++ b/libc/tinymath/fpclassify.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/math.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ __fpclassify: .leafprologue diff --git a/libc/tinymath/fpclassifyf.S b/libc/tinymath/fpclassifyf.S index f7b23ba7..a6c7fd07 100644 --- a/libc/tinymath/fpclassifyf.S +++ b/libc/tinymath/fpclassifyf.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/math.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ __fpclassifyf: .leafprologue diff --git a/libc/tinymath/fpclassifyl.S b/libc/tinymath/fpclassifyl.S index 03341148..49fb38cd 100644 --- a/libc/tinymath/fpclassifyl.S +++ b/libc/tinymath/fpclassifyl.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/math.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ __fpclassifyl: push %rbp diff --git a/libc/tinymath/frexp.S b/libc/tinymath/frexp.S index 6155b035..ba118be0 100644 --- a/libc/tinymath/frexp.S +++ b/libc/tinymath/frexp.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_frexp: .leafprologue diff --git a/libc/tinymath/hypot.S b/libc/tinymath/hypot.S index e084f2f5..6fc164bd 100644 --- a/libc/tinymath/hypot.S +++ b/libc/tinymath/hypot.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns euclidean distance in 2d space. tinymath_hypot: diff --git a/libc/tinymath/hypotf.S b/libc/tinymath/hypotf.S index 54342082..be3b04f6 100644 --- a/libc/tinymath/hypotf.S +++ b/libc/tinymath/hypotf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns euclidean distance in 2d space. tinymath_hypotf: diff --git a/libc/tinymath/hypotl.S b/libc/tinymath/hypotl.S index e7a6def3..efd3a4e2 100644 --- a/libc/tinymath/hypotl.S +++ b/libc/tinymath/hypotl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns euclidean distance in 2d space. tinymath_hypotl: diff --git a/libc/tinymath/ilogb.S b/libc/tinymath/ilogb.S index c3a9bf5f..bebd8aea 100644 --- a/libc/tinymath/ilogb.S +++ b/libc/tinymath/ilogb.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_ilogb: ezlea tinymath_ilogbl,ax diff --git a/libc/tinymath/ilogbf.S b/libc/tinymath/ilogbf.S index 63670c5e..4ac0af43 100644 --- a/libc/tinymath/ilogbf.S +++ b/libc/tinymath/ilogbf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_ilogbf: ezlea tinymath_ilogbl,ax diff --git a/libc/tinymath/ilogbl.S b/libc/tinymath/ilogbl.S index d349aa6e..a6def73c 100644 --- a/libc/tinymath/ilogbl.S +++ b/libc/tinymath/ilogbl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_ilogbl: .profilable diff --git a/libc/tinymath/isgreater.S b/libc/tinymath/isgreater.S index 7c3dd165..352563f1 100644 --- a/libc/tinymath/isgreater.S +++ b/libc/tinymath/isgreater.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_isgreaterf: .leafprologue diff --git a/libc/tinymath/isgreaterequal.S b/libc/tinymath/isgreaterequal.S index 287edc02..ba99d9fb 100644 --- a/libc/tinymath/isgreaterequal.S +++ b/libc/tinymath/isgreaterequal.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_isgreaterequal: .leafprologue diff --git a/libc/tinymath/isgreaterequalf.S b/libc/tinymath/isgreaterequalf.S index 868b1147..b5e8aa33 100644 --- a/libc/tinymath/isgreaterequalf.S +++ b/libc/tinymath/isgreaterequalf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_isgreaterequalf: .leafprologue diff --git a/libc/tinymath/isgreaterequall.S b/libc/tinymath/isgreaterequall.S index 39759bb1..1ae28256 100644 --- a/libc/tinymath/isgreaterequall.S +++ b/libc/tinymath/isgreaterequall.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_isgreaterequall: push %rbp diff --git a/libc/tinymath/isgreaterf.S b/libc/tinymath/isgreaterf.S index 570ac955..9aa5abaa 100644 --- a/libc/tinymath/isgreaterf.S +++ b/libc/tinymath/isgreaterf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_isgreater: .leafprologue diff --git a/libc/tinymath/isgreaterl.S b/libc/tinymath/isgreaterl.S index 786554c2..676fd706 100644 --- a/libc/tinymath/isgreaterl.S +++ b/libc/tinymath/isgreaterl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_isgreaterl: push %rbp diff --git a/libc/tinymath/isless.S b/libc/tinymath/isless.S index b7ebf777..98993efd 100644 --- a/libc/tinymath/isless.S +++ b/libc/tinymath/isless.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_isless: .leafprologue diff --git a/libc/tinymath/islessequal.S b/libc/tinymath/islessequal.S index 5003ca65..a194d969 100644 --- a/libc/tinymath/islessequal.S +++ b/libc/tinymath/islessequal.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_islessequal: .leafprologue diff --git a/libc/tinymath/islessequalf.S b/libc/tinymath/islessequalf.S index d52b69e6..268f2eb8 100644 --- a/libc/tinymath/islessequalf.S +++ b/libc/tinymath/islessequalf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_islessequalf: .leafprologue diff --git a/libc/tinymath/islessequall.S b/libc/tinymath/islessequall.S index c6240915..bdab3da0 100644 --- a/libc/tinymath/islessequall.S +++ b/libc/tinymath/islessequall.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_islessequall: push %rbp diff --git a/libc/tinymath/islessf.S b/libc/tinymath/islessf.S index a76843b8..fbe2ef30 100644 --- a/libc/tinymath/islessf.S +++ b/libc/tinymath/islessf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_islessf: .leafprologue diff --git a/libc/tinymath/islessgreater.S b/libc/tinymath/islessgreater.S index 095370ce..ffff8d43 100644 --- a/libc/tinymath/islessgreater.S +++ b/libc/tinymath/islessgreater.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_islessgreater: .leafprologue diff --git a/libc/tinymath/islessgreaterf.S b/libc/tinymath/islessgreaterf.S index 8b817854..211157c0 100644 --- a/libc/tinymath/islessgreaterf.S +++ b/libc/tinymath/islessgreaterf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_islessgreaterf: .leafprologue diff --git a/libc/tinymath/islessgreaterl.S b/libc/tinymath/islessgreaterl.S index 606817b1..26d497c6 100644 --- a/libc/tinymath/islessgreaterl.S +++ b/libc/tinymath/islessgreaterl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_islessgreaterl: push %rbp diff --git a/libc/tinymath/islessl.S b/libc/tinymath/islessl.S index 6b4a986e..d548dbbf 100644 --- a/libc/tinymath/islessl.S +++ b/libc/tinymath/islessl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_islessl: push %rbp diff --git a/libc/tinymath/isunordered.S b/libc/tinymath/isunordered.S index c09eabff..7e323518 100644 --- a/libc/tinymath/isunordered.S +++ b/libc/tinymath/isunordered.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_isunordered: .leafprologue diff --git a/libc/tinymath/isunorderedf.S b/libc/tinymath/isunorderedf.S index c0dcde96..22eec020 100644 --- a/libc/tinymath/isunorderedf.S +++ b/libc/tinymath/isunorderedf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_isunorderedf: .leafprologue diff --git a/libc/tinymath/isunorderedl.S b/libc/tinymath/isunorderedl.S index a393b52a..727996a2 100644 --- a/libc/tinymath/isunorderedl.S +++ b/libc/tinymath/isunorderedl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_isunorderedl: .leafprologue diff --git a/libc/tinymath/ldexp.S b/libc/tinymath/ldexp.S index 6fb1dbc5..9d87c9a6 100644 --- a/libc/tinymath/ldexp.S +++ b/libc/tinymath/ldexp.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_ldexp: push %rbp diff --git a/libc/tinymath/ldexpf.S b/libc/tinymath/ldexpf.S index 63c0932a..18cd3264 100644 --- a/libc/tinymath/ldexpf.S +++ b/libc/tinymath/ldexpf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_ldexpf: push %rbp diff --git a/libc/tinymath/ldexpl.S b/libc/tinymath/ldexpl.S index ef8f14e5..2bbbbd54 100644 --- a/libc/tinymath/ldexpl.S +++ b/libc/tinymath/ldexpl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_ldexpl: .profilable diff --git a/libc/tinymath/log.S b/libc/tinymath/log.S index 46ab62ea..289a7f98 100644 --- a/libc/tinymath/log.S +++ b/libc/tinymath/log.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns natural logarithm of 𝑥. / diff --git a/libc/tinymath/log10.S b/libc/tinymath/log10.S index 8cd6961b..4858aaa3 100644 --- a/libc/tinymath/log10.S +++ b/libc/tinymath/log10.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Calculates log₁₀𝑥. / diff --git a/libc/tinymath/log10f.S b/libc/tinymath/log10f.S index 8c7f86ec..ad1023e2 100644 --- a/libc/tinymath/log10f.S +++ b/libc/tinymath/log10f.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Calculates log₁₀𝑥. / diff --git a/libc/tinymath/log10l.S b/libc/tinymath/log10l.S index 265d73bb..52067ba0 100644 --- a/libc/tinymath/log10l.S +++ b/libc/tinymath/log10l.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Calculates log₁₀𝑥. / diff --git a/libc/tinymath/log1p.S b/libc/tinymath/log1p.S index d6a623e0..b6ae09a4 100644 --- a/libc/tinymath/log1p.S +++ b/libc/tinymath/log1p.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ log1p: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/log1pf.S b/libc/tinymath/log1pf.S index 671cdae3..9bc4f865 100644 --- a/libc/tinymath/log1pf.S +++ b/libc/tinymath/log1pf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ log1pf: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/log1pl.S b/libc/tinymath/log1pl.S index ba4a0138..804a3856 100644 --- a/libc/tinymath/log1pl.S +++ b/libc/tinymath/log1pl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ log1pl: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/log2.S b/libc/tinymath/log2.S index 6163d221..49d4c536 100644 --- a/libc/tinymath/log2.S +++ b/libc/tinymath/log2.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Calculates log₂𝑥. / diff --git a/libc/tinymath/log2f.S b/libc/tinymath/log2f.S index 69e25815..9d197903 100644 --- a/libc/tinymath/log2f.S +++ b/libc/tinymath/log2f.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ log2f: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/log2l.S b/libc/tinymath/log2l.S index f1b76282..e1f2eae5 100644 --- a/libc/tinymath/log2l.S +++ b/libc/tinymath/log2l.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Calculates log₂𝑥. / diff --git a/libc/tinymath/logb.S b/libc/tinymath/logb.S index 572a78df..e0925dc6 100644 --- a/libc/tinymath/logb.S +++ b/libc/tinymath/logb.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ logb: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/logbf.S b/libc/tinymath/logbf.S index 8af502fd..d7b9e119 100644 --- a/libc/tinymath/logbf.S +++ b/libc/tinymath/logbf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ logbf: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/logbl.S b/libc/tinymath/logbl.S index 27545cd4..e5dee2a8 100644 --- a/libc/tinymath/logbl.S +++ b/libc/tinymath/logbl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ logbl: push %rbp mov %rsp,%rbp diff --git a/libc/tinymath/logf.S b/libc/tinymath/logf.S index bfa9265f..78c0ac4f 100644 --- a/libc/tinymath/logf.S +++ b/libc/tinymath/logf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns natural logarithm of 𝑥. / diff --git a/libc/tinymath/logl.S b/libc/tinymath/logl.S index c796b927..de42b06a 100644 --- a/libc/tinymath/logl.S +++ b/libc/tinymath/logl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns natural logarithm of 𝑥. / diff --git a/libc/tinymath/lrint.S b/libc/tinymath/lrint.S index b0c836e7..b8771798 100644 --- a/libc/tinymath/lrint.S +++ b/libc/tinymath/lrint.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_lrint: cvtsd2siq %xmm0,%rax diff --git a/libc/tinymath/lrintf.S b/libc/tinymath/lrintf.S index 3d313c88..e9515678 100644 --- a/libc/tinymath/lrintf.S +++ b/libc/tinymath/lrintf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_lrintf: cvtss2siq %xmm0,%rax diff --git a/libc/tinymath/lrintl.S b/libc/tinymath/lrintl.S index e469a2bf..fb8fd967 100644 --- a/libc/tinymath/lrintl.S +++ b/libc/tinymath/lrintl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_lrintl: push %rbp diff --git a/libc/tinymath/lround.S b/libc/tinymath/lround.S index b37d8303..45865128 100644 --- a/libc/tinymath/lround.S +++ b/libc/tinymath/lround.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Rounds to nearest integer, away from zero. / diff --git a/libc/tinymath/lroundf.S b/libc/tinymath/lroundf.S index f4489773..ac5408b6 100644 --- a/libc/tinymath/lroundf.S +++ b/libc/tinymath/lroundf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Rounds to nearest integer, away from zero. / diff --git a/libc/tinymath/lroundl.S b/libc/tinymath/lroundl.S index 86b1cda8..17965f5e 100644 --- a/libc/tinymath/lroundl.S +++ b/libc/tinymath/lroundl.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/lib/pc.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_lroundl: push %rbp diff --git a/libc/tinymath/nearbyint.S b/libc/tinymath/nearbyint.S index e4d93369..758e32ec 100644 --- a/libc/tinymath/nearbyint.S +++ b/libc/tinymath/nearbyint.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_nearbyint: .profilable diff --git a/libc/tinymath/nearbyintf.S b/libc/tinymath/nearbyintf.S index 2831ecc8..b9480d78 100644 --- a/libc/tinymath/nearbyintf.S +++ b/libc/tinymath/nearbyintf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_nearbyintf: .profilable diff --git a/libc/tinymath/nearbyintl.S b/libc/tinymath/nearbyintl.S index 2a012aa8..5ca05bc4 100644 --- a/libc/tinymath/nearbyintl.S +++ b/libc/tinymath/nearbyintl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_nearbyintl: .profilable diff --git a/libc/tinymath/pow.S b/libc/tinymath/pow.S index 1928569f..3e76bdc1 100644 --- a/libc/tinymath/pow.S +++ b/libc/tinymath/pow.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 𝑥^𝑦. / diff --git a/libc/tinymath/powf.S b/libc/tinymath/powf.S index bd38fc72..2b2432ca 100644 --- a/libc/tinymath/powf.S +++ b/libc/tinymath/powf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 𝑥^𝑦. / diff --git a/libc/tinymath/powl.S b/libc/tinymath/powl.S index 090c0786..05fb1b5b 100644 --- a/libc/tinymath/powl.S +++ b/libc/tinymath/powl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns 𝑥^𝑦. / diff --git a/libc/tinymath/remainder.S b/libc/tinymath/remainder.S index 83af0d4e..025697f2 100644 --- a/libc/tinymath/remainder.S +++ b/libc/tinymath/remainder.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / remainder(𝑥,𝑦) means (𝑥 rem 𝑦) w/ rint()-style rounding. / diff --git a/libc/tinymath/remainderf.S b/libc/tinymath/remainderf.S index c0857b94..03d3c81f 100644 --- a/libc/tinymath/remainderf.S +++ b/libc/tinymath/remainderf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_remainderf: ezlea tinymath_remainderl,ax diff --git a/libc/tinymath/remainderl.S b/libc/tinymath/remainderl.S index 146314d9..399c57f3 100644 --- a/libc/tinymath/remainderl.S +++ b/libc/tinymath/remainderl.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/lib/pc.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_remainderl: push %rbp diff --git a/libc/tinymath/rint.S b/libc/tinymath/rint.S index 43487d08..d45e5ae7 100644 --- a/libc/tinymath/rint.S +++ b/libc/tinymath/rint.S @@ -20,7 +20,7 @@ #include "libc/nexgen32e/x86feature.h" #include "libc/bits/smmintrin.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_rint: #if !X86_NEED(SSE4_2) diff --git a/libc/tinymath/rintf.S b/libc/tinymath/rintf.S index c30f204c..4387213b 100644 --- a/libc/tinymath/rintf.S +++ b/libc/tinymath/rintf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_rintf: .leafprologue diff --git a/libc/tinymath/rintl.S b/libc/tinymath/rintl.S index 6e29dc5b..c2dc92aa 100644 --- a/libc/tinymath/rintl.S +++ b/libc/tinymath/rintl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_rintl: push %rbp diff --git a/libc/tinymath/round.S b/libc/tinymath/round.S index b2a7b13e..7c82a7d2 100644 --- a/libc/tinymath/round.S +++ b/libc/tinymath/round.S @@ -20,7 +20,7 @@ #include "libc/macros.h" #include "libc/bits/smmintrin.h" #include "libc/nexgen32e/x86feature.h" -.yoink __FILE__ +.source __FILE__ / Rounds to nearest integer, away from zero. / diff --git a/libc/tinymath/roundf.S b/libc/tinymath/roundf.S index a6a98be9..1a6f6bf3 100644 --- a/libc/tinymath/roundf.S +++ b/libc/tinymath/roundf.S @@ -20,7 +20,7 @@ #include "libc/macros.h" #include "libc/bits/smmintrin.h" #include "libc/nexgen32e/x86feature.h" -.yoink __FILE__ +.source __FILE__ / Rounds to nearest integer, away from zero. / diff --git a/libc/tinymath/roundl.S b/libc/tinymath/roundl.S index 24917a50..577117cd 100644 --- a/libc/tinymath/roundl.S +++ b/libc/tinymath/roundl.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/lib/pc.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_roundl: push %rbp diff --git a/libc/tinymath/scalb.S b/libc/tinymath/scalb.S index 96de7090..48f2db4c 100644 --- a/libc/tinymath/scalb.S +++ b/libc/tinymath/scalb.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_scalb: push %rbp diff --git a/libc/tinymath/scalbf.S b/libc/tinymath/scalbf.S index 21dacc92..f6d81aa4 100644 --- a/libc/tinymath/scalbf.S +++ b/libc/tinymath/scalbf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_scalbf: push %rbp diff --git a/libc/tinymath/scalbl.S b/libc/tinymath/scalbl.S index 2e70e07e..d8ffff21 100644 --- a/libc/tinymath/scalbl.S +++ b/libc/tinymath/scalbl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_scalbl: push %rbp diff --git a/libc/tinymath/scalbln.S b/libc/tinymath/scalbln.S index 72673446..8da9072b 100644 --- a/libc/tinymath/scalbln.S +++ b/libc/tinymath/scalbln.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_scalbln: push %rbp diff --git a/libc/tinymath/scalblnl.S b/libc/tinymath/scalblnl.S index 1e8ce10b..da769bf9 100644 --- a/libc/tinymath/scalblnl.S +++ b/libc/tinymath/scalblnl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_scalblnf: push %rbp diff --git a/libc/tinymath/scalbn.S b/libc/tinymath/scalbn.S index 89cacb2f..5dbdb53e 100644 --- a/libc/tinymath/scalbn.S +++ b/libc/tinymath/scalbn.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_scalbn: push %rbp diff --git a/libc/tinymath/scalbnf.S b/libc/tinymath/scalbnf.S index 30d6075f..118848c0 100644 --- a/libc/tinymath/scalbnf.S +++ b/libc/tinymath/scalbnf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_scalbnl: .profilable diff --git a/libc/tinymath/scalbnl.S b/libc/tinymath/scalbnl.S index fc538eac..1f9b774d 100644 --- a/libc/tinymath/scalbnl.S +++ b/libc/tinymath/scalbnl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_scalbnf: push %rbp diff --git a/libc/tinymath/signbit.S b/libc/tinymath/signbit.S index c91459a7..768bd936 100644 --- a/libc/tinymath/signbit.S +++ b/libc/tinymath/signbit.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_signbit: .leafprologue diff --git a/libc/tinymath/signbitf.S b/libc/tinymath/signbitf.S index f0f8f9b4..7a6132c4 100644 --- a/libc/tinymath/signbitf.S +++ b/libc/tinymath/signbitf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_signbitf: .leafprologue diff --git a/libc/tinymath/signbitl.S b/libc/tinymath/signbitl.S index 630a3f41..536cd207 100644 --- a/libc/tinymath/signbitl.S +++ b/libc/tinymath/signbitl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_signbitl: push %rbp diff --git a/libc/tinymath/significand.S b/libc/tinymath/significand.S index 24552ca7..dead6afe 100644 --- a/libc/tinymath/significand.S +++ b/libc/tinymath/significand.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_significand: push %rbp diff --git a/libc/tinymath/significandf.S b/libc/tinymath/significandf.S index 4622c63f..790bf337 100644 --- a/libc/tinymath/significandf.S +++ b/libc/tinymath/significandf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_significandf: push %rbp diff --git a/libc/tinymath/significandl.S b/libc/tinymath/significandl.S index 71b755a6..ced4c06d 100644 --- a/libc/tinymath/significandl.S +++ b/libc/tinymath/significandl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_significandl: push %rbp diff --git a/libc/tinymath/sin.S b/libc/tinymath/sin.S index 713550dc..d9ee8329 100644 --- a/libc/tinymath/sin.S +++ b/libc/tinymath/sin.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns sine of 𝑥. / diff --git a/libc/tinymath/sincos.S b/libc/tinymath/sincos.S index fe0a5294..6b77b042 100644 --- a/libc/tinymath/sincos.S +++ b/libc/tinymath/sincos.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns sine and cosine of 𝑥. / diff --git a/libc/tinymath/sincosf.S b/libc/tinymath/sincosf.S index 2aac57fa..5f3f4803 100644 --- a/libc/tinymath/sincosf.S +++ b/libc/tinymath/sincosf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns sine and cosine of 𝑥. / diff --git a/libc/tinymath/sincosl.S b/libc/tinymath/sincosl.S index faf4d5ba..9a7f0a1a 100644 --- a/libc/tinymath/sincosl.S +++ b/libc/tinymath/sincosl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns sine and cosine of 𝑥. / diff --git a/libc/tinymath/sinf.S b/libc/tinymath/sinf.S index ed5c9a00..c98fbd49 100644 --- a/libc/tinymath/sinf.S +++ b/libc/tinymath/sinf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns sine of 𝑥. / diff --git a/libc/tinymath/sinl.S b/libc/tinymath/sinl.S index 7afde135..e5953a93 100644 --- a/libc/tinymath/sinl.S +++ b/libc/tinymath/sinl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns sine of 𝑥. / diff --git a/libc/tinymath/sqrt.S b/libc/tinymath/sqrt.S index 83f072bf..7e51efe5 100644 --- a/libc/tinymath/sqrt.S +++ b/libc/tinymath/sqrt.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_sqrt: .leafprologue diff --git a/libc/tinymath/sqrtf.S b/libc/tinymath/sqrtf.S index 06810380..44e6ae11 100644 --- a/libc/tinymath/sqrtf.S +++ b/libc/tinymath/sqrtf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_sqrtf: .leafprologue diff --git a/libc/tinymath/sqrtl.S b/libc/tinymath/sqrtl.S index 5095b44f..f231dbe1 100644 --- a/libc/tinymath/sqrtl.S +++ b/libc/tinymath/sqrtl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns square root of 𝑥. / diff --git a/libc/tinymath/tan.S b/libc/tinymath/tan.S index 06829d60..d0007f5d 100644 --- a/libc/tinymath/tan.S +++ b/libc/tinymath/tan.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns tangent of 𝑥. / diff --git a/libc/tinymath/tanf.S b/libc/tinymath/tanf.S index 1f96d83c..f7f5a468 100644 --- a/libc/tinymath/tanf.S +++ b/libc/tinymath/tanf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns tangent of 𝑥. / diff --git a/libc/tinymath/tanl.S b/libc/tinymath/tanl.S index 4ecc9b01..0b85826f 100644 --- a/libc/tinymath/tanl.S +++ b/libc/tinymath/tanl.S @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "ape/lib/pc.h" #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Returns tangent of 𝑥. / diff --git a/libc/tinymath/trunc.S b/libc/tinymath/trunc.S index 8117dfd5..ba0f63ca 100644 --- a/libc/tinymath/trunc.S +++ b/libc/tinymath/trunc.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ / Rounds to integer, toward zero. / diff --git a/libc/tinymath/truncf.S b/libc/tinymath/truncf.S index 99ba9acf..6223c356 100644 --- a/libc/tinymath/truncf.S +++ b/libc/tinymath/truncf.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_truncf: .leafprologue diff --git a/libc/tinymath/truncl.S b/libc/tinymath/truncl.S index c70ff4e7..8e755bcc 100644 --- a/libc/tinymath/truncl.S +++ b/libc/tinymath/truncl.S @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/macros.h" -.yoink __FILE__ +.source __FILE__ tinymath_truncl: .profilable diff --git a/libc/unicode/strwidth.c b/libc/unicode/strwidth.c index dd54f572..8451d741 100644 --- a/libc/unicode/strwidth.c +++ b/libc/unicode/strwidth.c @@ -22,6 +22,7 @@ #include "libc/limits.h" #include "libc/str/internal.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" #include "libc/unicode/unicode.h" #define kOneTrueTabWidth 8 diff --git a/libc/zipos/zipcentraldir.S b/libc/zipos/zipcentraldir.S index 9acf3cbe..2c2fd079 100644 --- a/libc/zipos/zipcentraldir.S +++ b/libc/zipos/zipcentraldir.S @@ -49,10 +49,10 @@ __zip_end: .weak v_zip_commentsize .previous - yoink __zipos_close - yoink __zipos_fstat - yoink __zipos_open - yoink __zipos_parseuri - yoink __zipos_read - yoink __zipos_stat - yoink __FILE__ + .yoink __zipos_close + .yoink __zipos_fstat + .yoink __zipos_open + .yoink __zipos_parseuri + .yoink __zipos_read + .yoink __zipos_stat + .source __FILE__ diff --git a/test/libc/str/getutf16_test.c b/test/libc/str/getutf16_test.c index 0b60cf14..db5792be 100644 --- a/test/libc/str/getutf16_test.c +++ b/test/libc/str/getutf16_test.c @@ -19,6 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/bits.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" #include "libc/testlib/testlib.h" TEST(getutf16, testNul) { diff --git a/test/libc/str/tpdecode_test.c b/test/libc/str/tpdecode_test.c index 4c0e51d0..11c360eb 100644 --- a/test/libc/str/tpdecode_test.c +++ b/test/libc/str/tpdecode_test.c @@ -25,6 +25,7 @@ #include "libc/limits.h" #include "libc/runtime/gc.h" #include "libc/str/str.h" +#include "libc/str/tpdecode.h" #include "libc/testlib/testlib.h" wint_t wc; diff --git a/test/libc/str/tpencode_test.c b/test/libc/str/tpencode_test.c index 0aa2afa6..697192b6 100644 --- a/test/libc/str/tpencode_test.c +++ b/test/libc/str/tpencode_test.c @@ -21,6 +21,7 @@ #include "libc/bits/progn.h" #include "libc/bits/safemacros.h" #include "libc/str/str.h" +#include "libc/str/tpencode.h" #include "libc/testlib/testlib.h" char buf[8]; @@ -36,9 +37,10 @@ TEST(tpencode, testSpace) { } TEST(tpencode, testGlyph) { - ASSERT_BINEQ(u"ΓåÆ", PROGN(ASSERT_EQ(3, tpencode(buf, 8, u'→', false)), buf)); - ASSERT_BINEQ(u"ΓåÆ", - PROGN(ASSERT_EQ(3, (tpencode)(buf, 8, u'→', false)), buf)); + ASSERT_EQ(3, tpencode(buf, 8, u'→', false)); + ASSERT_BINEQ(u"ΓåÆ", buf); + ASSERT_EQ(3, (tpencode)(buf, 8, u'→', false)); + ASSERT_BINEQ(u"ΓåÆ", buf); } TEST(tpencode, testMathematicalNotMuhPolicyDrivenBehavior_negativeOne) { diff --git a/tool/emacs/cosmo-asm-mode.el b/tool/emacs/cosmo-asm-mode.el index 996630d0..36566656 100644 --- a/tool/emacs/cosmo-asm-mode.el +++ b/tool/emacs/cosmo-asm-mode.el @@ -8,6 +8,7 @@ ;; Reconfigures GNU Emacs syntax highlighting for GNU Assembler syntax. (require 'asm-mode) +(require 'cosmo-cpp-constants) (defun cosmo-regexpify (x) (let ((join (lambda (sep lis) @@ -144,6 +145,11 @@ ;; ("^/.*$" . font-lock-comment-face) + ;; Preprocessor Constants + ;; TODO(jart): Why won't it work?? ;_; + (,(concat "\\b" (cosmo-regexpify cosmo-cpp-constants) "\\b") ;; regexp-opt + 1 font-lock-constant-face) + ;; Immediate Argument ;; ;; - Valid @@ -192,7 +198,7 @@ cpp-font-lock-keywords - '(;; GNU-Style Assembler Comment (Ltd. 80x86 &c.) + `(;; GNU-Style Assembler Comment (Ltd. 80x86 &c.) ;; ;; - Valid ;; @@ -273,7 +279,7 @@ (1 font-lock-constant-face) (2 font-lock-constant-face)) - ;; Decimal Literal + ;; Bultin Constants ;; ;; - Valid ;; diff --git a/tool/emacs/cosmo-c-builtins.el b/tool/emacs/cosmo-c-builtins.el index 8be0eeab..b57289c1 100644 --- a/tool/emacs/cosmo-c-builtins.el +++ b/tool/emacs/cosmo-c-builtins.el @@ -1314,6 +1314,7 @@ "EXPROPRIATE" "YOINK" "STATIC_YOINK" + "STATIC_YOINK_SOURCE" "STRINGIFY" "isconstant" "chooseexpr" diff --git a/tool/emacs/cosmo-c-constants.el b/tool/emacs/cosmo-c-constants.el index 99538ba1..28d20cd9 100644 --- a/tool/emacs/cosmo-c-constants.el +++ b/tool/emacs/cosmo-c-constants.el @@ -1,232 +1,106 @@ +(defconst cosmo-c-constants-c11 + '("__func__" + "__VA_ARGS__" + "__STDC__" + "__STDC_HOSTED__" + "__STDC_VERSION__" + "__TIME__" + "__STDC_ISO_10646__" + "__STDC_MB_MIGHT_NEQ_WC__" + "__STDC_UTF_16__" + "__STDC_UTF_32__" + "__STDC_ANALYZABLE__" + "__STDC_IEC_559_COMPLEX__" + "__STDC_LIB_EXT1__" + "__STDC_NO_ATOMICS__" + "__STDC_NO_COMPLEX__" + "__STDC_NO_THREADS__" + "__STDC_NO_VLA__" + "__STDC_WANT_LIB_EXT1__")) + +(defconst cosmo-c-constants-limits + '("SIZEOF_SHORT" + "SIZEOF_INT" + "SIZEOF_LONG" + "SIZEOF_LONG_LONG" + "SIZEOF_POINTER" + "SIZEOF_PTRDIFF_T" + "SIZEOF_SIZE_T" + "SIZEOF_WCHAR_T" + "SIZEOF_WINT_T" + "SIZEOF_FLOAT" + "SIZEOF_FLOAT128" + "SIZEOF_DOUBLE" + "SIZEOF_FLOAT80" + "SIZEOF_LONG_DOUBLE" + "SIZEOF_INTMAX" + "SCHAR_MAX" + "SHRT_MAX" + "INT_MAX" + "LONG_MAX" + "LLONG_MAX" + "LONG_LONG_MAX" + "SIZE_MAX" + "INT8_MAX" + "INT16_MAX" + "INT32_MAX" + "INT64_MAX" + "WINT_MAX" + "WCHAR_MAX" + "INTPTR_MAX" + "PTRDIFF_MAX" + "SCHAR_MIN" + "SHRT_MIN" + "UINT_MIN" + "INT_MIN" + "LONG_MIN" + "LLONG_MIN" + "LONG_LONG_MIN" + "SIZE_MIN" + "INT8_MIN" + "INT16_MIN" + "INT32_MIN" + "INT64_MIN" + "INTMAX_MIN" + "INTPTR_MIN" + "WINT_MIN" + "WCHAR_MIN" + "PTRDIFF_MIN" + "USHRT_MAX" + "UINT_MAX" + "ULONG_MAX" + "ULLONG_MAX" + "ULONG_LONG_MAX" + "UINTPTR_MAX" + "UINT8_MAX" + "UINT16_MAX" + "UINT32_MAX" + "UINT64_MAX" + "USHRT_MIN" + "ULONG_MIN" + "ULLONG_MIN" + "ULONG_LONG_MIN" + "UINT8_MIN" + "UINT16_MIN" + "UINT32_MIN" + "UINT64_MIN" + "UINTMAX_MIN" + "UINTPTR_MIN" + "MB_CUR_MAX" + "MB_LEN_MAX" + "INTMAX_MAX" + "UINTMAX_MAX" + "INTMAX_MAX" + "UINTMAX_MAX" + "DBL_MIN" + "DBL_MAX" + "FLT_MIN" + "FLT_MAX")) + (defconst cosmo-c-constants-regex - (let ( - - (c11-constants - '("__func__" - "__STDC_IEC_559__" - "__VA_ARGS__" - "__FILE__" - "__LINE__" - "__DATE__" - "__STDC__" - "__STDC_HOSTED__" - "__STDC_VERSION__" - "__TIME__" - "__STDC_ISO_10646__" - "__STDC_MB_MIGHT_NEQ_WC__" - "__STDC_UTF_16__" - "__STDC_UTF_32__" - "__STDC_ANALYZABLE__" - "__STDC_IEC_559_COMPLEX__" - "__STDC_LIB_EXT1__" - "__STDC_NO_ATOMICS__" - "__STDC_NO_COMPLEX__" - "__STDC_NO_THREADS__" - "__STDC_NO_VLA__" - "__STDC_WANT_LIB_EXT1__")) - - (gcc-cpp-412-constants - '("__BASE_FILE__" - "__CHAR_BIT__" - "__FUNCTION__" - "__GNUC_MINOR__" - "__GNUC_PATCHLEVEL__" - "__GNUC__" - "__GNUG__" - "__INCLUDE_LEVEL__" - "__INTMAX_MAX__" - "__INT_MAX__" - "__LONG_LONG_MAX__" - "__LONG_MAX__" - "__SCHAR_MAX__" - "__SHRT_MAX__" - "__DBL_MIN__" - "__DBL_MAX__" - "__FLT_MIN__" - "__FLT_MAX__" - "__WCHAR_MAX__" - "__WCHAR_UNSIGNED__")) - - (gcc-cpp-92-constants - '("__x86_64__" - "__amd64__" - "__WINT_MAX__" - "__BIGGEST_ALIGNMENT__" - "__SIZE_MAX__" - "__PTRDIFF_MAX__" - "__UINTMAX_MAX__" - "__SIG_ATOMIC_MAX__" - "__INT8_MAX__" - "__INT16_MAX__" - "__INT32_MAX__" - "__INT64_MAX__" - "__UINT8_MAX__" - "__UINT16_MAX__" - "__UINT32_MAX__" - "__UINT64_MAX__" - "__INT_LEAST8_MAX__" - "__INT_LEAST16_MAX__" - "__INT_LEAST32_MAX__" - "__INT_LEAST64_MAX__" - "__UINT_LEAST8_MAX__" - "__UINT_LEAST16_MAX__" - "__UINT_LEAST32_MAX__" - "__UINT_LEAST64_MAX__" - "__INT_FAST8_MAX__" - "__INT_FAST16_MAX__" - "__INT_FAST32_MAX__" - "__INT_FAST64_MAX__" - "__UINT_FAST8_MAX__" - "__UINT_FAST16_MAX__" - "__UINT_FAST32_MAX__" - "__UINT_FAST64_MAX__" - "__INTPTR_MAX__" - "__UINTPTR_MAX__" - "__WCHAR_MIN__" - "__WINT_MIN__" - "__SIG_ATOMIC_MIN__" - "__SCHAR_WIDTH__" - "__SHRT_WIDTH__" - "__INT_WIDTH__" - "__LONG_WIDTH__" - "__LONG_LONG_WIDTH__" - "__PTRDIFF_WIDTH__" - "__SIG_ATOMIC_WIDTH__" - "__SIZE_WIDTH__" - "__WCHAR_WIDTH__" - "__WINT_WIDTH__" - "__INT_LEAST8_WIDTH__" - "__INT_LEAST16_WIDTH__" - "__INT_LEAST32_WIDTH__" - "__INT_LEAST64_WIDTH__" - "__INT_FAST8_WIDTH__" - "__INT_FAST16_WIDTH__" - "__INT_FAST32_WIDTH__" - "__INT_FAST64_WIDTH__" - "__INTPTR_WIDTH__" - "__INTMAX_WIDTH__" - "__SIZEOF_INT__" - "__SIZEOF_INTMAX__" - "__SIZEOF_UINTMAX__" - "__SIZEOF_LONG__" - "__SIZEOF_LONG_LONG__" - "__SIZEOF_SHORT__" - "__SIZEOF_POINTER__" - "__SIZEOF_FLOAT__" - "__SIZEOF_DOUBLE__" - "__SIZEOF_LONG_DOUBLE__" - "__SIZEOF_SIZE_T__" - "__SIZEOF_WCHAR_T__" - "__SIZEOF_WINT_T__" - "__SIZEOF_PTRDIFF_T__" - "__TIMESTAMP__")) - - (limits - '("SIZEOF_SHORT" - "SIZEOF_INT" - "SIZEOF_LONG" - "SIZEOF_LONG_LONG" - "SIZEOF_POINTER" - "SIZEOF_PTRDIFF_T" - "SIZEOF_SIZE_T" - "SIZEOF_WCHAR_T" - "SIZEOF_WINT_T" - "SIZEOF_FLOAT" - "SIZEOF_FLOAT128" - "SIZEOF_DOUBLE" - "SIZEOF_FLOAT80" - "SIZEOF_LONG_DOUBLE" - "SIZEOF_INTMAX" - "SCHAR_MAX" - "SHRT_MAX" - "INT_MAX" - "LONG_MAX" - "LLONG_MAX" - "LONG_LONG_MAX" - "SIZE_MAX" - "INT8_MAX" - "INT16_MAX" - "INT32_MAX" - "INT64_MAX" - "WINT_MAX" - "WCHAR_MAX" - "INTPTR_MAX" - "PTRDIFF_MAX" - "SCHAR_MIN" - "SHRT_MIN" - "UINT_MIN" - "INT_MIN" - "LONG_MIN" - "LLONG_MIN" - "LONG_LONG_MIN" - "SIZE_MIN" - "INT8_MIN" - "INT16_MIN" - "INT32_MIN" - "INT64_MIN" - "INTMAX_MIN" - "INTPTR_MIN" - "WINT_MIN" - "WCHAR_MIN" - "PTRDIFF_MIN" - "USHRT_MAX" - "UINT_MAX" - "ULONG_MAX" - "ULLONG_MAX" - "ULONG_LONG_MAX" - "UINTPTR_MAX" - "UINT8_MAX" - "UINT16_MAX" - "UINT32_MAX" - "UINT64_MAX" - "USHRT_MIN" - "ULONG_MIN" - "ULLONG_MIN" - "ULONG_LONG_MIN" - "UINT8_MIN" - "UINT16_MIN" - "UINT32_MIN" - "UINT64_MIN" - "UINTMAX_MIN" - "UINTPTR_MIN" - "MB_CUR_MAX" - "MB_LEN_MAX" - "INTMAX_MAX" - "UINTMAX_MAX" - "INTMAX_MAX" - "UINTMAX_MAX" - "DBL_MIN" - "DBL_MAX" - "FLT_MIN" - "FLT_MAX")) - - (cosmopolitan-constants - '("__SAUCE__" - "PAGESIZE" - "FRAMESIZE" - "BIGPAGESIZE" - "ENV_MAX" - "ARG_MAX" - "CMD_MAX" - "PATH_MAX" - "BUFSIZ" - "CACHELINE" - "CHAR_BIT" - "NAME_MAX" - "NSIG" - "CHILD_MAX" - "OPEN_MAX" - "ATEXIT_MAX" - "__x86__" - "__i386__")) - - ) - (concat "\\_<" - (regexp-opt (append c11-constants - gcc-cpp-412-constants - gcc-cpp-92-constants - cosmopolitan-constants - limits)) - "\\_>"))) + (concat "\\_<" + (regexp-opt (append cosmo-c-constants-c11 + cosmo-c-constants-limits)) + "\\_>")) (provide 'cosmo-c-constants) diff --git a/tool/emacs/cosmo-cpp-constants.el b/tool/emacs/cosmo-cpp-constants.el new file mode 100644 index 00000000..585efce4 --- /dev/null +++ b/tool/emacs/cosmo-cpp-constants.el @@ -0,0 +1,133 @@ +(defconst cosmo-cpp-constants-c11 + '("__STDC_IEC_559__" + "__FILE__" + "__LINE__" + "__DATE__")) + +(defconst cosmo-cpp-constants-gcc-412 + '("__BASE_FILE__" + "__CHAR_BIT__" + "__FUNCTION__" + "__GNUC_MINOR__" + "__GNUC_PATCHLEVEL__" + "__GNUC__" + "__GNUG__" + "__INCLUDE_LEVEL__" + "__INTMAX_MAX__" + "__INT_MAX__" + "__LONG_LONG_MAX__" + "__LONG_MAX__" + "__SCHAR_MAX__" + "__SHRT_MAX__" + "__DBL_MIN__" + "__DBL_MAX__" + "__FLT_MIN__" + "__FLT_MAX__" + "__WCHAR_MAX__" + "__WCHAR_UNSIGNED__")) + +(defconst cosmo-cpp-constants-gcc-92 + '("__x86_64__" + "__amd64__" + "__WINT_MAX__" + "__BIGGEST_ALIGNMENT__" + "__SIZE_MAX__" + "__PTRDIFF_MAX__" + "__UINTMAX_MAX__" + "__SIG_ATOMIC_MAX__" + "__INT8_MAX__" + "__INT16_MAX__" + "__INT32_MAX__" + "__INT64_MAX__" + "__UINT8_MAX__" + "__UINT16_MAX__" + "__UINT32_MAX__" + "__UINT64_MAX__" + "__INT_LEAST8_MAX__" + "__INT_LEAST16_MAX__" + "__INT_LEAST32_MAX__" + "__INT_LEAST64_MAX__" + "__UINT_LEAST8_MAX__" + "__UINT_LEAST16_MAX__" + "__UINT_LEAST32_MAX__" + "__UINT_LEAST64_MAX__" + "__INT_FAST8_MAX__" + "__INT_FAST16_MAX__" + "__INT_FAST32_MAX__" + "__INT_FAST64_MAX__" + "__UINT_FAST8_MAX__" + "__UINT_FAST16_MAX__" + "__UINT_FAST32_MAX__" + "__UINT_FAST64_MAX__" + "__INTPTR_MAX__" + "__UINTPTR_MAX__" + "__WCHAR_MIN__" + "__WINT_MIN__" + "__SIG_ATOMIC_MIN__" + "__SCHAR_WIDTH__" + "__SHRT_WIDTH__" + "__INT_WIDTH__" + "__LONG_WIDTH__" + "__LONG_LONG_WIDTH__" + "__PTRDIFF_WIDTH__" + "__SIG_ATOMIC_WIDTH__" + "__SIZE_WIDTH__" + "__WCHAR_WIDTH__" + "__WINT_WIDTH__" + "__INT_LEAST8_WIDTH__" + "__INT_LEAST16_WIDTH__" + "__INT_LEAST32_WIDTH__" + "__INT_LEAST64_WIDTH__" + "__INT_FAST8_WIDTH__" + "__INT_FAST16_WIDTH__" + "__INT_FAST32_WIDTH__" + "__INT_FAST64_WIDTH__" + "__INTPTR_WIDTH__" + "__INTMAX_WIDTH__" + "__SIZEOF_INT__" + "__SIZEOF_INTMAX__" + "__SIZEOF_UINTMAX__" + "__SIZEOF_LONG__" + "__SIZEOF_LONG_LONG__" + "__SIZEOF_SHORT__" + "__SIZEOF_POINTER__" + "__SIZEOF_FLOAT__" + "__SIZEOF_DOUBLE__" + "__SIZEOF_LONG_DOUBLE__" + "__SIZEOF_SIZE_T__" + "__SIZEOF_WCHAR_T__" + "__SIZEOF_WINT_T__" + "__SIZEOF_PTRDIFF_T__" + "__TIMESTAMP__")) + +(defconst cosmo-cpp-constants-cosmopolitan + '("__SAUCE__" + "PAGESIZE" + "FRAMESIZE" + "BIGPAGESIZE" + "ENV_MAX" + "ARG_MAX" + "CMD_MAX" + "PATH_MAX" + "BUFSIZ" + "CACHELINE" + "CHAR_BIT" + "NAME_MAX" + "NSIG" + "CHILD_MAX" + "OPEN_MAX" + "ATEXIT_MAX" + "IM_FEELING_NAUGHTY" + "__x86__" + "__i386__")) + +(defconst cosmo-cpp-constants + (append cosmo-cpp-constants-c11 + cosmo-cpp-constants-gcc-92 + cosmo-cpp-constants-gcc-412 + cosmo-cpp-constants-cosmopolitan)) + +(defconst cosmo-cpp-constants-regex + (concat "\\_<" (regexp-opt cosmo-cpp-constants) "\\_>")) + +(provide 'cosmo-cpp-constants) diff --git a/tool/emacs/cosmo-format.el b/tool/emacs/cosmo-format.el index 48d04876..c4b50e9b 100644 --- a/tool/emacs/cosmo-format.el +++ b/tool/emacs/cosmo-format.el @@ -114,18 +114,15 @@ (write-region nil nil tmp) (let ((buf (get-buffer-create "*clang-format*")) (exe (cosmo--find-clang-format-bin))) - ;; (with-current-buffer buf - ;; (set-process-sentinel - ;; (call-process exe tmp t nil arg) - ;; (lambda (_ _) - ;; (display-buffer buf)))) (with-current-buffer buf (call-process exe tmp t nil arg)) (replace-buffer-contents buf) (kill-buffer buf) (delete-file tmp nil)))))))) -(add-hook 'before-save-hook 'cosmo-format) +;; Emacs 26.3+ needed for replace-buffer-contents; so worth it!! +(unless (version-list-< (version-to-list emacs-version) '(26 3)) + (add-hook 'before-save-hook 'cosmo-format)) (provide 'cosmo-format) diff --git a/tool/emacs/cosmo-stuff.el b/tool/emacs/cosmo-stuff.el index 78558b05..b768eeed 100644 --- a/tool/emacs/cosmo-stuff.el +++ b/tool/emacs/cosmo-stuff.el @@ -14,10 +14,11 @@ (require 'asm-mode) (require 'cc-mode) (require 'fortran) +(require 'cosmo-c-types) +(require 'cosmo-c-keywords) (require 'cosmo-c-builtins) (require 'cosmo-c-constants) -(require 'cosmo-c-keywords) -(require 'cosmo-c-types) +(require 'cosmo-cpp-constants) (require 'dired) (require 'javadown) (require 'ld-script) @@ -693,6 +694,7 @@ (font-lock-add-keywords nil `((,cosmo-c-keywords-regex . font-lock-keyword-face) (,cosmo-c-builtins-regex . font-lock-builtin-face) + (,cosmo-cpp-constants-regex . font-lock-constant-face) (,cosmo-c-constants-regex . font-lock-constant-face) (,cosmo-c-types-regex . font-lock-type-face)))) diff --git a/tool/emacs/cosmo.el b/tool/emacs/cosmo.el new file mode 100644 index 00000000..88fb36d7 --- /dev/null +++ b/tool/emacs/cosmo.el @@ -0,0 +1,7 @@ +(require 'ld-script) +(require 'optinfo-mode) +(require 'protobuf-mode) +(require 'cosmo-format) +(require 'cosmo-asm-mode) +(require 'cosmo-stuff) +(provide 'cosmo) diff --git a/tool/scripts/configure-emacs.sh b/tool/scripts/configure-emacs.sh new file mode 100755 index 00000000..735b3695 --- /dev/null +++ b/tool/scripts/configure-emacs.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if ! [ -e ape/ape.S ]; then + echo please cd to cosmopolitan root directory >&2 + exit 1 +fi + +COSMOPOLITAN="$PWD" +EMACSCONFIGS="$HOME/.emacs.d/init.el" +[ -e "$EMACSCONFIGS" ] || EMACSCONFIGS="$HOME/.emacs" + +cat >>"$EMACSCONFIGS" <