<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/run-make/comment-section, branch master</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=master</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-09-05T08:43:38+00:00</updated>
<entry>
<title>tests: use renamed `stdin_buf`</title>
<updated>2024-09-05T08:43:38+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>39484203+jieyouxu@users.noreply.github.com</email>
</author>
<published>2024-09-05T00:02:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=afed862b26335b37539ec2cd295e34ef3fb844be'/>
<id>urn:sha1:afed862b26335b37539ec2cd295e34ef3fb844be</id>
<content type='text'>
</content>
</entry>
<entry>
<title>remove unused imports from rmake tests</title>
<updated>2024-08-10T18:06:10+00:00</updated>
<author>
<name>Rémy Rakic</name>
<email>remy.rakic+github@gmail.com</email>
</author>
<published>2024-08-10T18:06:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=141d9dc3a57ebadc229b7eec7df4357c3aa15620'/>
<id>urn:sha1:141d9dc3a57ebadc229b7eec7df4357c3aa15620</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reformat `use` declarations.</title>
<updated>2024-07-28T22:26:52+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-07-28T22:13:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=84ac80f1921afc243d71fd0caaa4f2838c294102'/>
<id>urn:sha1:84ac80f1921afc243d71fd0caaa4f2838c294102</id>
<content type='text'>
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
</content>
</entry>
<entry>
<title>tests: update for `rfs` rename</title>
<updated>2024-07-17T13:34:18+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>jieyouxu@outlook.com</email>
</author>
<published>2024-07-17T13:31:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d69cc1ccbf9d25225add138a4b0f6ee424d0d59a'/>
<id>urn:sha1:d69cc1ccbf9d25225add138a4b0f6ee424d0d59a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tests: update for renamed `fs` module in run_make_support</title>
<updated>2024-07-17T13:32:29+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>jieyouxu@outlook.com</email>
</author>
<published>2024-07-17T12:42:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=636be91cc0d8e406171ec4aa1b5dea4b77d1a714'/>
<id>urn:sha1:636be91cc0d8e406171ec4aa1b5dea4b77d1a714</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Improve `target` method API in `run-make-support`</title>
<updated>2024-07-01T08:55:57+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume.gomez@huawei.com</email>
</author>
<published>2024-07-01T08:55:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fcfac05657acf387392f853904c917ac06c082c5'/>
<id>urn:sha1:fcfac05657acf387392f853904c917ac06c082c5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Migrate `run-make/comment-section` to `rmake.rs`</title>
<updated>2024-06-19T19:55:57+00:00</updated>
<author>
<name>Jerry Wang</name>
<email>jerrylwang123@gmail.com</email>
</author>
<published>2024-06-16T01:47:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f44494cb3ad0a1c599620e9c020cf7e6a54bb774'/>
<id>urn:sha1:f44494cb3ad0a1c599620e9c020cf7e6a54bb774</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update Makefiles with explanatory comments</title>
<updated>2024-05-08T02:12:36+00:00</updated>
<author>
<name>Julien</name>
<email>96022417+Oneirical@users.noreply.github.com</email>
</author>
<published>2024-05-07T13:39:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=79cf61a9aeb83ce030ba9db59e79a93a9c507040'/>
<id>urn:sha1:79cf61a9aeb83ce030ba9db59e79a93a9c507040</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Support `.comment` section like GCC/Clang (`!llvm.ident`)</title>
<updated>2023-07-21T20:01:50+00:00</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2022-05-28T23:10:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=74b8d324eb77a8f337b35dc68ac91b0c2c06debc'/>
<id>urn:sha1:74b8d324eb77a8f337b35dc68ac91b0c2c06debc</id>
<content type='text'>
Both GCC and Clang write by default a `.comment` section with compiler
information:

```txt
$ gcc -c -xc /dev/null &amp;&amp; readelf -p '.comment' null.o

String dump of section '.comment':
  [     1]  GCC: (GNU) 11.2.0

$ clang -c -xc /dev/null &amp;&amp; readelf -p '.comment' null.o

String dump of section '.comment':
  [     1]  clang version 14.0.1 (https://github.com/llvm/llvm-project.git c62053979489ccb002efe411c3af059addcb5d7d)
```

They also implement the `-Qn` flag to avoid doing so:

```txt
$ gcc -Qn -c -xc /dev/null &amp;&amp; readelf -p '.comment' null.o
readelf: Warning: Section '.comment' was not dumped because it does not exist!

$ clang -Qn -c -xc /dev/null &amp;&amp; readelf -p '.comment' null.o
readelf: Warning: Section '.comment' was not dumped because it does not exist!
```

So far, `rustc` only does it for WebAssembly targets and only
when debug info is enabled:

```txt
$ echo 'fn main(){}' | rustc --target=wasm32-unknown-unknown --emit=llvm-ir -Cdebuginfo=2 - &amp;&amp; grep llvm.ident rust_out.ll
!llvm.ident = !{!27}
```

In the RFC part of this PR it was decided to always add
the information, which gets us closer to other popular compilers.
An opt-out flag like GCC and Clang may be added later on if deemed
necessary.

Implementation-wise, this covers both `ModuleLlvm::new()` and
`ModuleLlvm::new_metadata()` cases by moving the addition to
`context::create_module` and adds a few test cases.

ThinLTO also sees the `llvm.ident` named metadata duplicated (in
temporary outputs), so this deduplicates it like it is done for
`wasm.custom_sections`. The tests also check this duplication does
not take place.

Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
</feed>
