Bug 28759 - ar: Add --thin to avoid 'T' conflict with X/Open System Interface
Summary: ar: Add --thin to avoid 'T' conflict with X/Open System Interface
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2022-01-10 21:05 UTC by Fangrui Song
Modified: 2022-01-11 17:01 UTC (History)
1 user (show)

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2022-01-10 21:05:50 UTC

[XSI] [Option Start] Allow filename truncation of extracted files whose archive names are longer than the file system can support. By default, extracting a file with a name that is too long shall be an error; a diagnostic message shall be written and the file shall not be extracted. [Option End]

FreeBSD ar/macOS ar/elfutils (eu-ar) appear to take this interpretation. For portability, the 'T' thin archive semantics should be discouraged in favor of --thin.
Comment 2 Sourceware Commits 2022-01-11 17:00:15 UTC
The master branch has been updated by Fangrui Song <maskray@sourceware.org>:


commit d1b69c506f7855e5b90039abdadaf1d05b085c4c
Author: Fangrui Song <maskray@google.com>
Date:   Tue Jan 11 08:59:40 2022 -0800

    ar: Add --thin for creating thin archives
    In many ar implementations (FreeBSD, elfutils, etc), -T has the X/Open
    System Interface specified semantics. Therefore -T for thin archives is
    not recommended for portability. -T is deprecated without diagnostics.
        PR binutils/28759
        * ar.c (long_options): Add --thin.
        (usage) Add --thin. Deprecate -T without diagnostics.
        * doc/binutils.texi: Add doc.
        * NEWS: Mention --thin.
        * binutils/testsuite/binutils-all/ar.exp: Add tests.
Comment 3 Fangrui Song 2022-01-11 17:01:56 UTC
Fixed for the upcoming 2.38