This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Remove <cstdlib> includes
ClosedPublic

Authored by philnik on Mar 14 2023, 11:52 AM.

Details

Reviewers
ldionne
Mordante
Group Reviewers
Restricted Project
Commits
rG75196f8e72be: [libc++] Remove <cstdlib> includes
Summary

We changed the abort calls when trying to throw exceptions in -fno-exceptions mode to __verbose_abort calls, which removes the dependency in most files.

Diff Detail

Event Timeline

philnik created this revision.Mar 14 2023, 11:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2023, 11:52 AM
Herald added a subscriber: smeenai. · View Herald Transcript
philnik requested review of this revision.Mar 14 2023, 11:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2023, 11:52 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik updated this revision to Diff 505351.Mar 14 2023, 7:37 PM

Try to fix CI

ldionne accepted this revision.Mar 16 2023, 8:12 AM

Can you explain that those are not necessary anymore since we moved to __verbose_abort in your commit message? Thanks for the patch, LGTM!

This revision is now accepted and ready to land.Mar 16 2023, 8:12 AM
philnik updated this revision to Diff 505900.Mar 16 2023, 12:26 PM

Try to fix CI

philnik edited the summary of this revision. (Show Details)Mar 16 2023, 6:01 PM
emaste added a subscriber: dim.Mar 16 2023, 7:16 PM
emaste added a subscriber: emaste.

@emaste @dim Could you please take a look at the CI failure?

dim added a comment.Apr 2 2023, 2:48 PM

Hm, seems the actual error is:

In file included from <module-includes>:34:
In file included from /home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/build/generic-cxx2b/include/c++/v1/complex.h:27:
In file included from /home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/build/generic-cxx2b/include/c++/v1/ccomplex:21:
In file included from /home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/build/generic-cxx2b/include/c++/v1/complex:242:
In file included from /home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/build/generic-cxx2b/include/c++/v1/sstream:191:
In file included from /home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/build/generic-cxx2b/include/c++/v1/istream:169:
In file included from /home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/build/generic-cxx2b/include/c++/v1/ostream:178:
/home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/build/generic-cxx2b/include/c++/v1/locale:762:26: error: use of undeclared identifier 'strtoll_l'; did you mean 'wcstoll_l'?
        long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
                         ^

so it could be that we define strtoll_l in an unexpected place. As far as I remember our locale headers were slightly different from other systems... I can't look for a fix right now as it's too late here, but maybe @emaste has some time :)

emaste added a comment.Apr 3 2023, 6:11 AM

Our definition is in /usr/include/xlocale/_stdlib.h which has the comment:

/*
 * Extended locale versions of the locale-aware functions from stdlib.h.
 *
 * Include <stdlib.h> before <xlocale.h> to expose these.
 */
...
long long                strtoll_l(const char *, char **, int, locale_t);
...

/usr/include/xlocal.h:

#ifdef _STDLIB_H_
#include <xlocale/_stdlib.h>
#endif

but there is also this in stdlib.h:

#ifdef _XLOCALE_H_
#include <xlocale/_stdlib.h>
#endif

which was added in:

commit 3ac9d659890471a1936268bfec06e74caf9025df
Author: David Chisnall <theraven@FreeBSD.org>
Date:   Wed Mar 28 12:11:54 2012 +0000

    Correctly expose xlocale functions if people include the headers in the wrong
    order (as some ports apparently do).
    
    Approved by:    dim (mentor)

Notes:
    svn path=/head/; revision=233600
philnik updated this revision to Diff 510569.Apr 3 2023, 11:19 AM

Try to fix CI

philnik updated this revision to Diff 511392.Apr 6 2023, 6:15 AM

Try to fix CI

philnik updated this revision to Diff 511897.Apr 8 2023, 9:19 AM

Next try

This revision was landed with ongoing or failed builds.Apr 8 2023, 5:52 PM
This revision was automatically updated to reflect the committed changes.