If you hike in reasonably dry areas (meaning the humidity levels aren’t constantly 70% and above and/or it’s not raining all the time), I’ve found the following fabrics excel at minimizing odor and funk: linen, Lyocell/Tencel (really any kind of rayon, but this is the strongest and most durable version), sheep’s wool, alpaca, mohair, untreated silk, (really any animal and protein based fiber works well in this regard).
There seems to be some kind of connection between a material’s water attraction vs repulsion levels, and degree of odor prevention vs build up. Â The more water attracting, the more odor prevention and conversely the other way around.
If you look at synthetics for example, the least odor building up and retaining material is nylon, but as the moisture regain property decreases, it gets more and more stink prone. Â After nylon is acrylic–not horrible, but not great. Â Then polyester, which untreated is pretty stanky, and then the worst–polypropylene–the stankiest of the stanky (and very low, almost 0% moisture regain).
As a compromise, I like blends between the above two groups for moderate, non extreme conditions. Â Particularly nylon-lyocell unless the temps are consistently colder. Â If it’s colder, then synthetic-animal fiber blends (like polyester with some wool).
Consistent  humidity levels also matter a lot.  The more dry it is, the more I prefer water absorbent materials (and if it’s hot or warm, then cellulose based-linen, tencel, etc), and conversely the more humid or wet it is, the more I prefer the less absorbent materials–with polygiene treated, wicking, thin, very breathable all or almost all polyester for like sub tropical and tropical places with consistently very high humidity (like OR Echo or Patagonia Caplilene Lightweight baselayer type fabrics).