Software multiplexing: share your libraries and statically link them too

We describe a compiler strategy we call “ Software Multiplexing ” that achieves many benefits of both statically linked and dynamically linked libraries, and adds some additional advantages. Specifically, it achieves the code size benefits of dynamically linked libraries while eliminating the major...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Proceedings of ACM on programming languages 2018-11, Vol.2 (OOPSLA), p.1-26
Hauptverfasser: Dietz, Will, Adve, Vikram
Format: Artikel
Sprache:eng
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
container_end_page 26
container_issue OOPSLA
container_start_page 1
container_title Proceedings of ACM on programming languages
container_volume 2
creator Dietz, Will
Adve, Vikram
description We describe a compiler strategy we call “ Software Multiplexing ” that achieves many benefits of both statically linked and dynamically linked libraries, and adds some additional advantages. Specifically, it achieves the code size benefits of dynamically linked libraries while eliminating the major disadvantages: unexpected failures due to missing dependences, slow startup times, reduced execution performance due to indirect references to globals, and the potential for security vulnerabilities. We design Software Multiplexing so that it works even in the common case where application build systems support only dynamic and not static linking; we have automatically built thousands of Linux software packages in this way. Software Multiplexing combines two ideas: Automatic Multicall , i.e., where multiple independent programs are automatically merged into a single executable, and Static Linking of Shared Libraries , which works by linking an IR-level version of application code and all its libraries, even if the libraries are normally compiled as shared, before native code generation. The benefits are achieved primarily through deduplication of libraries across the multiplexed programs, while using static linking, and secondly through more effective unused code elimination for statically linked shared libraries. Compared with equivalent dynamically linked programs, allmux-optimized programs start more quickly and even have slightly lower memory usage and total disk size. Compared with equivalent statically linked programs, allmux-optimized programs are much smaller in both aggregate size and memory usage, and have similar startup times and execution performance. We have implemented Software Multiplexing in a tool called allmux, part of the open-source ALLVM project. Example results show that when the LLVM Compiler Infrastructure is optimized using allmux, the resulting binaries and libraries are 18.3% smaller and 30% faster than the default production version. For 74 other packages containing 2–166 programs each, multiplexing each package into one static binary reduces the aggregate package size by 39% (geometric mean) compared with dynamic linking.
doi_str_mv 10.1145/3276524
format Article
fullrecord <record><control><sourceid>crossref</sourceid><recordid>TN_cdi_crossref_primary_10_1145_3276524</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>10_1145_3276524</sourcerecordid><originalsourceid>FETCH-LOGICAL-c2098-f1beaec2e050e4aeb96eef7b6bc1134a47e4a41419cf8fad9cad642176994d763</originalsourceid><addsrcrecordid>eNpNkE1LAzEYhIMoWGrxL-TmaTVfm2y8SVErFDyo5-Xd7Bu7mu2WJEX337ulPXia4RkYhiHkmrNbzlV5J4XRpVBnZCaUKQuuBD__5y_JIqUvxhi3UlXSzsjqbfD5ByLSfh9ytwv4220_72naHNg47CMNXRMhdpgobFuaMuTOQQjjFGy_ad5gT_MwXJELDyHh4qRz8vH0-L5cFevX55flw7pwgtmq8LxBQCeQlQwVYGM1ojeNbhznUoEyE1Vccet85aG1Dlo9LTfaWtUaLefk5tjr4pBSRF_vYtdDHGvO6sMH9ekD-Qctn07J</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype></control><display><type>article</type><title>Software multiplexing: share your libraries and statically link them too</title><source>Association for Computing Machinery</source><source>EZB Electronic Journals Library</source><creator>Dietz, Will ; Adve, Vikram</creator><creatorcontrib>Dietz, Will ; Adve, Vikram</creatorcontrib><description>We describe a compiler strategy we call “ Software Multiplexing ” that achieves many benefits of both statically linked and dynamically linked libraries, and adds some additional advantages. Specifically, it achieves the code size benefits of dynamically linked libraries while eliminating the major disadvantages: unexpected failures due to missing dependences, slow startup times, reduced execution performance due to indirect references to globals, and the potential for security vulnerabilities. We design Software Multiplexing so that it works even in the common case where application build systems support only dynamic and not static linking; we have automatically built thousands of Linux software packages in this way. Software Multiplexing combines two ideas: Automatic Multicall , i.e., where multiple independent programs are automatically merged into a single executable, and Static Linking of Shared Libraries , which works by linking an IR-level version of application code and all its libraries, even if the libraries are normally compiled as shared, before native code generation. The benefits are achieved primarily through deduplication of libraries across the multiplexed programs, while using static linking, and secondly through more effective unused code elimination for statically linked shared libraries. Compared with equivalent dynamically linked programs, allmux-optimized programs start more quickly and even have slightly lower memory usage and total disk size. Compared with equivalent statically linked programs, allmux-optimized programs are much smaller in both aggregate size and memory usage, and have similar startup times and execution performance. We have implemented Software Multiplexing in a tool called allmux, part of the open-source ALLVM project. Example results show that when the LLVM Compiler Infrastructure is optimized using allmux, the resulting binaries and libraries are 18.3% smaller and 30% faster than the default production version. For 74 other packages containing 2–166 programs each, multiplexing each package into one static binary reduces the aggregate package size by 39% (geometric mean) compared with dynamic linking.</description><identifier>ISSN: 2475-1421</identifier><identifier>EISSN: 2475-1421</identifier><identifier>DOI: 10.1145/3276524</identifier><language>eng</language><ispartof>Proceedings of ACM on programming languages, 2018-11, Vol.2 (OOPSLA), p.1-26</ispartof><lds50>peer_reviewed</lds50><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed><citedby>FETCH-LOGICAL-c2098-f1beaec2e050e4aeb96eef7b6bc1134a47e4a41419cf8fad9cad642176994d763</citedby><cites>FETCH-LOGICAL-c2098-f1beaec2e050e4aeb96eef7b6bc1134a47e4a41419cf8fad9cad642176994d763</cites></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>314,780,784,27915,27916</link.rule.ids></links><search><creatorcontrib>Dietz, Will</creatorcontrib><creatorcontrib>Adve, Vikram</creatorcontrib><title>Software multiplexing: share your libraries and statically link them too</title><title>Proceedings of ACM on programming languages</title><description>We describe a compiler strategy we call “ Software Multiplexing ” that achieves many benefits of both statically linked and dynamically linked libraries, and adds some additional advantages. Specifically, it achieves the code size benefits of dynamically linked libraries while eliminating the major disadvantages: unexpected failures due to missing dependences, slow startup times, reduced execution performance due to indirect references to globals, and the potential for security vulnerabilities. We design Software Multiplexing so that it works even in the common case where application build systems support only dynamic and not static linking; we have automatically built thousands of Linux software packages in this way. Software Multiplexing combines two ideas: Automatic Multicall , i.e., where multiple independent programs are automatically merged into a single executable, and Static Linking of Shared Libraries , which works by linking an IR-level version of application code and all its libraries, even if the libraries are normally compiled as shared, before native code generation. The benefits are achieved primarily through deduplication of libraries across the multiplexed programs, while using static linking, and secondly through more effective unused code elimination for statically linked shared libraries. Compared with equivalent dynamically linked programs, allmux-optimized programs start more quickly and even have slightly lower memory usage and total disk size. Compared with equivalent statically linked programs, allmux-optimized programs are much smaller in both aggregate size and memory usage, and have similar startup times and execution performance. We have implemented Software Multiplexing in a tool called allmux, part of the open-source ALLVM project. Example results show that when the LLVM Compiler Infrastructure is optimized using allmux, the resulting binaries and libraries are 18.3% smaller and 30% faster than the default production version. For 74 other packages containing 2–166 programs each, multiplexing each package into one static binary reduces the aggregate package size by 39% (geometric mean) compared with dynamic linking.</description><issn>2475-1421</issn><issn>2475-1421</issn><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2018</creationdate><recordtype>article</recordtype><recordid>eNpNkE1LAzEYhIMoWGrxL-TmaTVfm2y8SVErFDyo5-Xd7Bu7mu2WJEX337ulPXia4RkYhiHkmrNbzlV5J4XRpVBnZCaUKQuuBD__5y_JIqUvxhi3UlXSzsjqbfD5ByLSfh9ytwv4220_72naHNg47CMNXRMhdpgobFuaMuTOQQjjFGy_ad5gT_MwXJELDyHh4qRz8vH0-L5cFevX55flw7pwgtmq8LxBQCeQlQwVYGM1ojeNbhznUoEyE1Vccet85aG1Dlo9LTfaWtUaLefk5tjr4pBSRF_vYtdDHGvO6sMH9ekD-Qctn07J</recordid><startdate>20181101</startdate><enddate>20181101</enddate><creator>Dietz, Will</creator><creator>Adve, Vikram</creator><scope>AAYXX</scope><scope>CITATION</scope></search><sort><creationdate>20181101</creationdate><title>Software multiplexing: share your libraries and statically link them too</title><author>Dietz, Will ; Adve, Vikram</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-c2098-f1beaec2e050e4aeb96eef7b6bc1134a47e4a41419cf8fad9cad642176994d763</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2018</creationdate><toplevel>peer_reviewed</toplevel><toplevel>online_resources</toplevel><creatorcontrib>Dietz, Will</creatorcontrib><creatorcontrib>Adve, Vikram</creatorcontrib><collection>CrossRef</collection><jtitle>Proceedings of ACM on programming languages</jtitle></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext</fulltext></delivery><addata><au>Dietz, Will</au><au>Adve, Vikram</au><format>journal</format><genre>article</genre><ristype>JOUR</ristype><atitle>Software multiplexing: share your libraries and statically link them too</atitle><jtitle>Proceedings of ACM on programming languages</jtitle><date>2018-11-01</date><risdate>2018</risdate><volume>2</volume><issue>OOPSLA</issue><spage>1</spage><epage>26</epage><pages>1-26</pages><issn>2475-1421</issn><eissn>2475-1421</eissn><abstract>We describe a compiler strategy we call “ Software Multiplexing ” that achieves many benefits of both statically linked and dynamically linked libraries, and adds some additional advantages. Specifically, it achieves the code size benefits of dynamically linked libraries while eliminating the major disadvantages: unexpected failures due to missing dependences, slow startup times, reduced execution performance due to indirect references to globals, and the potential for security vulnerabilities. We design Software Multiplexing so that it works even in the common case where application build systems support only dynamic and not static linking; we have automatically built thousands of Linux software packages in this way. Software Multiplexing combines two ideas: Automatic Multicall , i.e., where multiple independent programs are automatically merged into a single executable, and Static Linking of Shared Libraries , which works by linking an IR-level version of application code and all its libraries, even if the libraries are normally compiled as shared, before native code generation. The benefits are achieved primarily through deduplication of libraries across the multiplexed programs, while using static linking, and secondly through more effective unused code elimination for statically linked shared libraries. Compared with equivalent dynamically linked programs, allmux-optimized programs start more quickly and even have slightly lower memory usage and total disk size. Compared with equivalent statically linked programs, allmux-optimized programs are much smaller in both aggregate size and memory usage, and have similar startup times and execution performance. We have implemented Software Multiplexing in a tool called allmux, part of the open-source ALLVM project. Example results show that when the LLVM Compiler Infrastructure is optimized using allmux, the resulting binaries and libraries are 18.3% smaller and 30% faster than the default production version. For 74 other packages containing 2–166 programs each, multiplexing each package into one static binary reduces the aggregate package size by 39% (geometric mean) compared with dynamic linking.</abstract><doi>10.1145/3276524</doi><tpages>26</tpages><oa>free_for_read</oa></addata></record>
fulltext fulltext
identifier ISSN: 2475-1421
ispartof Proceedings of ACM on programming languages, 2018-11, Vol.2 (OOPSLA), p.1-26
issn 2475-1421
2475-1421
language eng
recordid cdi_crossref_primary_10_1145_3276524
source Association for Computing Machinery; EZB Electronic Journals Library
title Software multiplexing: share your libraries and statically link them too
url https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-01-14T18%3A04%3A15IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-crossref&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=Software%20multiplexing:%20share%20your%20libraries%20and%20statically%20link%20them%20too&rft.jtitle=Proceedings%20of%20ACM%20on%20programming%20languages&rft.au=Dietz,%20Will&rft.date=2018-11-01&rft.volume=2&rft.issue=OOPSLA&rft.spage=1&rft.epage=26&rft.pages=1-26&rft.issn=2475-1421&rft.eissn=2475-1421&rft_id=info:doi/10.1145/3276524&rft_dat=%3Ccrossref%3E10_1145_3276524%3C/crossref%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_id=info:pmid/&rfr_iscdi=true